/* AVstackr Blueprint modal — the shell the Proposal, Estimate and Executive Summary modals share.
   ========================================================================
   A plain stylesheet rather than a scoped .razor.css, because scoped CSS is per-component by
   design and this vocabulary is deliberately shared across several. Every class is `bp-` prefixed
   so it cannot collide with Bootstrap or with a component's own scoped rules; a modal keeps its
   own prefix for the parts only it has.

   Every colour is an --app-* token from themes/theme-base.css, so the whole family follows the
   app's theme with no [data-bs-theme] rules of its own. No new hex.

   Three type tiers and no web fonts. The designs name Barlow Condensed, Barlow and IBM Plex Mono;
   the app loads none of them and has no Google Fonts link, so the display tiers inherit the body
   font and carry their weight through uppercase casing and letter-spacing, which is what was doing
   most of the work anyway. Only the mono tier needs a real family and the system stack covers it.

   Radius is 2px everywhere. Status pips are the only circles. One shadow, on the modal.
   ======================================================================== */

:root {
    --bp-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── shell ──────────────────────────────────────────────────────────────── */

.bp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 1050;
}

.bp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 940px;
    max-width: calc(100vw - 48px);
    display: flex;
    flex-direction: column;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-strong);
    border-radius: 2px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
    z-index: 1051;
}

/* Registration marks, hung outside each corner. Typographic, not SVG. */
.bp-mark {
    position: absolute;
    font-family: var(--bp-mono);
    font-size: 13px;
    line-height: 1;
    color: var(--app-border-strong);
    pointer-events: none;
}
.bp-mark-tl { top: -7px; left: -7px; }
.bp-mark-tr { top: -7px; right: -7px; }
.bp-mark-bl { bottom: -7px; left: -7px; }
.bp-mark-br { bottom: -7px; right: -7px; }

/* ── header ─────────────────────────────────────────────────────────────── */

.bp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px 18px;
    border-bottom: 1px solid var(--app-border-hairline);
    background: linear-gradient(180deg, var(--app-accent-tint), transparent);
}

.bp-kicker {
    font-family: var(--bp-mono);
    font-size: 11px;
    letter-spacing: .16em;
    color: var(--app-text-label);
}

.bp-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 6px;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--app-text-strong);
}

/* Version chip beside a title, e.g. V0 on the summary draft. */
.bp-title-tag {
    padding: 2px 7px 3px;
    font-family: var(--bp-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .12em;
    color: var(--app-text-label);
    border: 1px solid var(--app-border-strong);
    border-radius: 2px;
}

.bp-sub {
    font-family: var(--bp-mono);
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--app-text-disabled);
}

.bp-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--bp-mono);
    font-size: 13px;
    color: var(--app-text-label);
    background: transparent;
    border: 1px solid var(--app-border-hairline);
    border-radius: 2px;
    cursor: pointer;
}
.bp-close:hover {
    color: var(--app-text-strong);
    border-color: var(--app-border-strong);
    background: var(--app-surface-hover);
}

/* ── body + sections ────────────────────────────────────────────────────── */

.bp-body {
    flex: 1;
    overflow-y: auto;
    max-height: min(74vh, 760px);
    padding: 22px 24px;
}

.bp-section + .bp-section { margin-top: 28px; }

.bp-section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 18px;
}

.bp-section-num {
    font-family: var(--bp-mono);
    font-size: 11px;
    letter-spacing: .16em;
    color: var(--app-accent-border);
}

.bp-section-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--app-text-strong);
}

/* Right-hand mono note in a section header — a count, an OPTIONAL flag, a link pair. */
.bp-section-note {
    margin-left: auto;
    font-family: var(--bp-mono);
    font-size: 10px;
    letter-spacing: .12em;
    color: var(--app-text-disabled);
}

/* A sentence under a section header explaining what the section's action does. */
.bp-section-hint {
    margin: -8px 0 16px;
    font-family: var(--bp-mono);
    font-size: 10px;
    letter-spacing: .06em;
    color: var(--app-text-disabled);
}

/* ── fields ─────────────────────────────────────────────────────────────── */

.bp-label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--bp-mono);
    font-size: 10px;
    letter-spacing: .16em;
    color: var(--app-text-label);
}

/* A required marker reads as a word, not an asterisk — an asterisk with no legend says nothing. */
.bp-required {
    margin-left: 6px;
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--app-status-warn);
}

.bp-input,
.bp-select,
.bp-textarea {
    width: 100%;
    font-size: 14.5px;
    color: var(--app-text-strong);
    background: var(--app-surface-sunken);
    border: 1px solid var(--app-border-strong);
    border-radius: 2px;
}

.bp-input { padding: 10px 12px; }
.bp-select { appearance: none; padding: 10px 30px 10px 12px; cursor: pointer; }
.bp-textarea { padding: 12px; font-size: 14px; line-height: 1.55; resize: vertical; }

.bp-input:focus,
.bp-select:focus,
.bp-textarea:focus {
    outline: none;
    border-color: var(--app-accent-border);
}

.bp-input::placeholder,
.bp-textarea::placeholder { color: var(--app-text-disabled); }

.bp-select:disabled,
.bp-input:disabled { color: var(--app-text-disabled); cursor: not-allowed; }

/* Strings a human reads character by character — ZIP, email, phone, dates. */
.bp-input-mono { font-family: var(--bp-mono); font-size: 13px; }

/* A field whose value is required and missing. Border only; the label's REQUIRED carries the word. */
.bp-input.is-invalid,
.bp-input.is-invalid:focus { border-color: var(--app-status-warn); }

/* Dark mode hides the native picker glyph entirely without this. */
.bp-input[type="date"] { font-family: var(--bp-mono); font-size: 13px; padding: 9px 12px; }
[data-bs-theme="dark"] .bp-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.55); }

/* A mono note under a field, usually something derived from it. */
.bp-field-note {
    margin-top: 8px;
    font-family: var(--bp-mono);
    font-size: 10px;
    letter-spacing: .06em;
    color: var(--app-text-disabled);
}

/* ── either/or option buttons ───────────────────────────────────────────── */

.bp-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.bp-choice {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 11px 12px;
    background: var(--app-surface-sunken);
    border: 1px solid var(--app-border-hairline);
    border-radius: 2px;
    cursor: pointer;
}
.bp-choice:hover { border-color: var(--app-accent-border); }
.bp-choice.is-on {
    background: var(--app-accent-tint);
    border-color: var(--app-accent-border);
}

.bp-choice-title {
    font-family: var(--bp-mono);
    font-size: 11px;
    letter-spacing: .1em;
    color: var(--app-text-strong);
}
.bp-choice-desc { font-size: 12.5px; color: var(--app-text-data); }

/* The compact single-line variant, used for the address mode pair. */
.bp-choice-sm {
    display: block;
    text-align: center;
    padding: 8px 10px;
    font-family: var(--bp-mono);
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--app-text-label);
    background: var(--app-surface-sunken);
    border: 1px solid var(--app-border-hairline);
    border-radius: 2px;
    cursor: pointer;
}
.bp-choice-sm:hover { border-color: var(--app-accent-border); }
.bp-choice-sm.is-on {
    color: var(--app-text-strong);
    background: var(--app-accent-tint);
    border-color: var(--app-accent-border);
}

/* ── framed sub-panel with a notched name badge ─────────────────────────── */

.bp-panel {
    position: relative;
    padding: 26px 16px 16px;
    background: linear-gradient(180deg, var(--app-accent-tint), transparent);
    border: 1px solid var(--app-border-strong);
    border-radius: 2px;
}

/* No top/left border, so it reads as cut into the frame rather than sitting on it. */
.bp-panel-badge {
    position: absolute;
    top: -1px;
    left: -1px;
    padding: 3px 8px 4px;
    font-family: var(--bp-mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    color: var(--app-text-data);
    background: var(--app-surface-raised);
    border-right: 1px solid var(--app-border-strong);
    border-bottom: 1px solid var(--app-border-strong);
    border-radius: 0 0 2px 0;
}

/* ── readout ────────────────────────────────────────────────────────────── */

.bp-readout {
    padding: 12px;
    font-family: var(--bp-mono);
    font-size: 11px;
    line-height: 1.7;
    letter-spacing: .04em;
    color: var(--app-text-disabled);
    background: var(--app-surface-readout);
    border: 1px solid var(--app-border-hairline);
    border-radius: 2px;
}

/* Single-line variant for a URL, with a copy button beside it. */
.bp-readout-row { display: flex; align-items: stretch; gap: 8px; }

.bp-readout-line {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-family: var(--bp-mono);
    font-size: 11.5px;
    color: var(--app-text-data);
    background: var(--app-surface-readout);
    border: 1px solid var(--app-border-hairline);
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── buttons ────────────────────────────────────────────────────────────── */

.bp-btn-primary {
    flex: 0 0 auto;
    padding: 10px 20px;
    font-family: var(--bp-mono);
    font-size: 11.5px;
    letter-spacing: .12em;
    color: #fff;
    background: var(--app-accent-fill);
    border: 1px solid var(--app-accent-border);
    border-radius: 2px;
    cursor: pointer;
}
.bp-btn-primary:hover:not(:disabled) { background: var(--app-accent-border); }
.bp-btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.bp-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-family: var(--bp-mono);
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--app-text-data);
    background: transparent;
    border: 1px solid var(--app-border-strong);
    border-radius: 2px;
    cursor: pointer;
}
.bp-btn-outline:hover:not(:disabled) {
    color: var(--app-text-strong);
    background: var(--app-surface-hover);
}
.bp-btn-outline:disabled { opacity: .5; cursor: not-allowed; }

/* Filled-well variant — an outline button that needs to read as available, not quiet. */
.bp-btn-solid {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    font-family: var(--bp-mono);
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--app-text-strong);
    background: var(--app-surface-hover);
    border: 1px solid var(--app-border-strong);
    border-radius: 2px;
    cursor: pointer;
}
.bp-btn-solid:hover:not(:disabled) { border-color: var(--app-accent-border); }
.bp-btn-solid:disabled { opacity: .5; cursor: not-allowed; }

.bp-btn-text {
    padding: 0;
    font-family: var(--bp-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    color: var(--app-text-label);
    background: transparent;
    border: none;
    cursor: pointer;
}
.bp-btn-text.is-accent { color: var(--app-accent-border); }
.bp-btn-text.is-warn { color: var(--app-status-warn); }
.bp-btn-text:hover:not(:disabled) { color: var(--app-text-strong); }
.bp-btn-text:disabled { opacity: .5; cursor: not-allowed; }

.bp-btn-sm {
    padding: 6px 9px;
    font-family: var(--bp-mono);
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--app-text-label);
    background: transparent;
    border: 1px solid var(--app-border-hairline);
    border-radius: 2px;
    cursor: pointer;
}
.bp-btn-sm:hover:not(:disabled) {
    color: var(--app-text-strong);
    border-color: var(--app-border-strong);
}
.bp-btn-sm:disabled { opacity: .5; cursor: not-allowed; }

/* ── status ─────────────────────────────────────────────────────────────── */

.bp-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--bp-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
}

.bp-pip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.bp-status.is-warn { color: var(--app-status-warn); }
.bp-status.is-ok { color: var(--app-status-ok); }
.bp-status.is-dim { color: var(--app-text-disabled); }
.bp-status.is-quiet { color: var(--app-text-label); }
/* An absence is not an event — "not opened" gets no dot. */
.bp-status.is-quiet .bp-pip { background: transparent; }

/* ── error ──────────────────────────────────────────────────────────────── */

.bp-error {
    margin-top: 14px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--app-status-warn);
    background: var(--app-surface-sunken);
    border: 1px solid var(--app-status-warn);
    border-radius: 2px;
}

/* ── action row above the footer ────────────────────────────────────────── */

.bp-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--app-border-hairline);
}

.bp-action-note {
    font-family: var(--bp-mono);
    font-size: 10.5px;
    letter-spacing: .06em;
    line-height: 1.7;
    color: var(--app-text-label);
}

/* ── footer ─────────────────────────────────────────────────────────────── */

.bp-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-top: 1px solid var(--app-border-hairline);
    background: var(--app-surface-sunken);
}

.bp-foot-note {
    font-family: var(--bp-mono);
    font-size: 10px;
    letter-spacing: .08em;
    color: var(--app-text-disabled);
}

.bp-foot-actions { display: flex; align-items: center; gap: 10px; }
