/* ==========================================================================
   FYSH — Public: Buyer's Guide
   CR: fysh-buyers-guide-2026-07-01
   Namespace: byg-   Mobile-first.
   ========================================================================== */

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.byg-page { max-width: 800px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.byg-hero {
    background: var(--navy);
    border-radius: 10px;
    padding: 32px 28px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.byg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 10% 60%, rgba(201,168,76,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.byg-hero__eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
}
.byg-hero__title {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.16;
    margin-bottom: 12px;
}
.byg-hero__sub {
    font-size: 0.9rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.6);
    max-width: 540px;
    margin-bottom: 18px;
}
.byg-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.38);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 14px;
}
.byg-hero__meta strong { color: rgba(255,255,255,0.6); }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.byg-progress {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.byg-progress__track {
    flex: 1 1 240px;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.byg-progress__bar {
    height: 100%;
    background: var(--green, #16a34a);
    border-radius: 99px;
    width: 0%;
    transition: width 0.3s;
}
.byg-progress__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.byg-progress__lbl { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* CR: fysh-guide-progress-2026-07-18 — Save-status pill (signed-in users) */
.byg-progress__save {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
    background: rgba(22,163,74,0.09);
    color: #14733e;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    transition: background 0.18s, color 0.18s;
}
.byg-progress__save-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
    transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
}
.byg-progress__save[data-state="saving"] {
    background: rgba(30,91,168,0.09);
    color: #0F2340;
}
.byg-progress__save[data-state="saving"] .byg-progress__save-dot {
    background: #1E5BA8;
    box-shadow: 0 0 0 3px rgba(30,91,168,0.15);
    animation: byg-progress-pulse 1.1s ease-in-out infinite;
}
.byg-progress__save[data-state="error"] {
    background: rgba(192,57,43,0.09);
    color: #922B1F;
    cursor: pointer;
}
.byg-progress__save[data-state="error"] .byg-progress__save-dot {
    background: #C0392B;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.15);
}
@keyframes byg-progress-pulse {
    0%, 100% { transform: scale(1);   opacity: 1;   }
    50%      { transform: scale(1.3); opacity: 0.55;}
}

/* CTA shown to anonymous visitors */
.byg-progress__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
    background: rgba(30,91,168,0.09);
    color: #1E5BA8;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.byg-progress__cta:hover,
.byg-progress__cta:focus-visible {
    background: rgba(30,91,168,0.14);
    border-color: rgba(30,91,168,0.35);
    outline: none;
}
.byg-progress__cta i { font-size: 0.9rem; }

@media (max-width: 640px) {
    .byg-progress { padding: 12px 14px; }
    .byg-progress__track { flex-basis: 100%; }
    .byg-progress__meta { width: 100%; justify-content: space-between; }
    .byg-progress__cta,
    .byg-progress__save { flex: 0 1 auto; }
}

/* ── Print / utility bar ──────────────────────────────────────────────────── */
.byg-print-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
}
.byg-print-bar__label { font-size: 0.8rem; color: var(--muted); }
.byg-print-bar__label strong { color: var(--navy); }
.byg-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--navy);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.byg-print-btn:hover { opacity: 0.88; }

/* ── TOC ──────────────────────────────────────────────────────────────────── */
.byg-toc {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}
.byg-toc__head {
    padding: 11px 16px;
    background: #FAFAF8;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.byg-toc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 480px) { .byg-toc__grid { grid-template-columns: 1fr; } }
.byg-toc__item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--navy);
    border-bottom: 1px solid var(--border-light, #f0ede8);
    transition: background 0.1s;
}
.byg-toc__item:hover { background: var(--cream); }
.byg-toc__num { font-size: 0.65rem; font-weight: 700; color: var(--gold); min-width: 1.4em; }

/* ── Section card ─────────────────────────────────────────────────────────── */
.byg-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    scroll-margin-top: 80px;
}
.byg-section__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: #FAFAF8;
}
.byg-section__num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.byg-section__title {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
    margin: 0;
}
.byg-section__body { padding: 20px; }

/* ── Prose ────────────────────────────────────────────────────────────────── */
.byg-prose {
    font-size: 0.875rem;
    line-height: 1.78;
    color: #374151;
    margin-bottom: 14px;
}
.byg-prose:last-child { margin-bottom: 0; }
.byg-prose strong { color: var(--navy); }
.byg-h3 {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy);
    margin: 18px 0 8px;
}
.byg-h3:first-child { margin-top: 0; }

/* ── Callouts ─────────────────────────────────────────────────────────────── */
.byg-callout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 14px 0;
}
.byg-callout:last-child { margin-bottom: 0; }
.byg-callout__icon { flex-shrink: 0; font-size: 14px; margin-top: 2px; }
.byg-callout__title { font-weight: 600; font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 3px; }
.byg-callout--tip    { background: #F0FDF4; border: 1px solid #BBF7D0; color: #14532D; }
.byg-callout--tip    .byg-callout__icon,
.byg-callout--tip    .byg-callout__title { color: #16A34A; }
.byg-callout--warn   { background: #FFFBEB; border: 1px solid #FEF08A; color: #713F12; }
.byg-callout--warn   .byg-callout__icon,
.byg-callout--warn   .byg-callout__title { color: #CA8A04; }
.byg-callout--info   { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A5F; }
.byg-callout--info   .byg-callout__icon,
.byg-callout--info   .byg-callout__title { color: #1E5BA8; }
.byg-callout--legal  { background: #0F2340; border: 1px solid #1E3A5F; color: rgba(255,255,255,0.82); }
.byg-callout--legal  .byg-callout__icon,
.byg-callout--legal  .byg-callout__title { color: var(--gold); }
.byg-callout--expert { background: #0F2340; border: 1px solid #1E3A5F; color: rgba(255,255,255,0.82); }
.byg-callout--expert .byg-callout__icon,
.byg-callout--expert .byg-callout__title { color: var(--gold); }

/* ── Numbered steps ───────────────────────────────────────────────────────── */
.byg-steps { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.byg-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.86rem;
    color: #374151;
    line-height: 1.6;
}
.byg-step__num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.66rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.byg-step strong { color: var(--navy); }

/* ── Costs table ──────────────────────────────────────────────────────────── */
.byg-costs {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin: 12px 0;
}
.byg-costs th {
    text-align: left;
    padding: 7px 10px;
    background: #FAFAF8;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.byg-costs td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light, #f0ede8);
    color: #374151;
    line-height: 1.5;
    vertical-align: top;
}
.byg-costs td:last-child { color: var(--navy); font-weight: 500; white-space: nowrap; }
.byg-costs tr:last-child td { border-bottom: none; }
.byg-costs tr.byg-costs__total td { font-weight: 700; color: var(--navy); border-top: 2px solid var(--border); }

/* ── Checklist ────────────────────────────────────────────────────────────── */
.byg-checklist { list-style: none; padding: 0; margin: 0; }
.byg-check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-light, #f0ede8);
    font-size: 0.845rem;
    color: #374151;
    line-height: 1.55;
}
.byg-check-item:last-child { border-bottom: none; }
.byg-check-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    accent-color: var(--navy);
    cursor: pointer;
}
.byg-check-item--legal   .byg-check-tag { background: #FEF3CD; color: #7A5700; }
.byg-check-item--action  .byg-check-tag { background: #DBEAFE; color: #1E3A5F; }
.byg-check-item--caution .byg-check-tag { background: #FEE2E2; color: #7F1D1D; }
.byg-check-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 5px;
}

/* ── SDLT Calculator ──────────────────────────────────────────────────────── */
.byg-sdlt {
    background: var(--navy);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 18px;
}
.byg-sdlt__head {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.byg-sdlt__eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 4px;
}
.byg-sdlt__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 4px;
}
.byg-sdlt__sub { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin: 0; }

.byg-sdlt__body { padding: 20px 24px; }

.byg-sdlt__field { margin-bottom: 18px; }
.byg-sdlt__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 7px;
    letter-spacing: 0.03em;
}
.byg-sdlt__input-wrap { position: relative; }
.byg-sdlt__prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
}
.byg-sdlt__input {
    width: 100%;
    padding: 12px 12px 12px 28px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 7px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #FFFFFF;
    font-family: var(--font-sans, system-ui);
    transition: border-color 0.15s, background 0.15s;
}
.byg-sdlt__input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.1);
}
.byg-sdlt__input::placeholder { color: rgba(255,255,255,0.25); font-weight: 400; font-size: 1rem; }
.byg-sdlt__slider {
    width: 100%;
    margin-top: 10px;
    accent-color: var(--gold);
    cursor: pointer;
}
.byg-sdlt__slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    margin-top: 3px;
}

/* Buyer type radios */
.byg-sdlt__types {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.byg-sdlt__type {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.byg-sdlt__type:has(input:checked) {
    background: rgba(201,168,76,0.12);
    border-color: var(--gold);
}
.byg-sdlt__type input { accent-color: var(--gold); cursor: pointer; }
.byg-sdlt__type-label { font-size: 0.85rem; font-weight: 600; color: #FFFFFF; }
.byg-sdlt__type-desc  { font-size: 0.73rem; color: rgba(255,255,255,0.45); margin-top: 1px; }

/* Result panel */
.byg-sdlt__result {
    margin-top: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    overflow: hidden;
}
.byg-sdlt__result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
    gap: 8px;
}
.byg-sdlt__result-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}
.byg-sdlt__total {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}
.byg-sdlt__effective { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-top: 3px; }

/* Breakdown table */
.byg-sdlt__table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.byg-sdlt__table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.byg-sdlt__table td { padding: 8px 12px; color: rgba(255,255,255,0.65); border-bottom: 1px solid rgba(255,255,255,0.05); }
.byg-sdlt__table tr:last-child td { border-bottom: none; }
.byg-sdlt__table tr.sdlt-row--has-tax td { color: rgba(255,255,255,0.85); }
.byg-sdlt__table .sdlt-tax-cell { font-weight: 600; color: var(--gold); }

/* Note */
.byg-sdlt__note {
    margin: 14px 18px 18px;
    padding: 10px 12px;
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 5px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.55;
}
.byg-sdlt__disclaimer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.32);
    line-height: 1.5;
}
.byg-sdlt__disclaimer a { color: rgba(255,255,255,0.45); }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
    .site-header, .site-footer, .byg-print-bar,
    .byg-toc, .byg-progress { display: none !important; }
    body { background: #fff !important; }
    .byg-page { max-width: 100% !important; }
    .byg-hero {
        background: #0F2340 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-radius: 0;
        margin-bottom: 14pt;
    }
    .byg-hero__title { font-size: 18pt; }
    .byg-section { break-inside: avoid; margin-bottom: 10pt; border: 1px solid #ccc !important; }
    .byg-section__head { background: #f5f5f5 !important; }
    .byg-callout { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .byg-sdlt { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .byg-check-item input[type="checkbox"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a::after { content: none !important; }
}
