/* Home page (01Shared/Default.aspx). Menu.css is still used by the older per-user copies. */
:root {
    --brand: #0a5bd6;
    --brand-dark: #07439f;
    --brand-soft: #e8f0fd;
    --ink: #13233a;
    --muted: #5b6b82;
    --line: #dce3ee;
    --field-line: #8492a6;   /* text box outlines: darker than --line so they're easy to see */
    --bg: #f3f6fb;
    --card: #ffffff;
    --alert: #b42318;
    --alert-soft: #fdecea;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--brand); }

.page { max-width: 960px; margin: 0 auto; padding: 0 16px 40px; position: relative; }   /* positioned like .hero, so the cards that overlap the header draw on top of it */

/* Header */
.hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 36px 16px 44px;
    position: relative;
    text-align: center;
}
.hero .intro { display: block; font-size: 1rem; opacity: .9; font-style: italic; }
.hero .intro.intro-alert {
    display: inline-block;
    background: var(--alert-soft);
    color: var(--alert);
    font-style: normal;
    font-weight: 600;
    opacity: 1;
    padding: 4px 12px;
    border-radius: 999px;
}
.hero .lo-name { display: block; font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 700; letter-spacing: -.01em; margin-top: 6px; }
.hero .lo-co { display: block; font-size: 1.125rem; font-weight: 500; opacity: .95; margin-top: 2px; }
.hero .lo-contact { display: block; font-size: .95rem; opacity: .85; margin-top: 10px; overflow-wrap: anywhere; }

/* Loan officer photo: beside the name on wide screens, above it on phones. Without a photo the text stays centred. */
.hero-inner { align-items: center; display: flex; gap: 28px; justify-content: center; margin: 0 auto; max-width: 960px; }
.hero-inner:has(.lo-photo) .hero-text { text-align: left; }
.hero .lo-photo {
    border: 4px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    flex: none;
    height: 128px;
    object-fit: cover;
    object-position: 50% 12%;   /* favour the top of the photo, where the face usually is */
    width: 128px;
}
@media (max-width: 640px) {
    .hero-inner { flex-direction: column; gap: 14px; }
    .hero-inner:has(.lo-photo) .hero-text { text-align: center; }
    .hero .lo-photo { height: 104px; width: 104px; }
}

/* Notice */
.notice {
    background: var(--alert-soft);
    border: 1px solid #f5c2bd;
    border-radius: var(--radius);
    color: var(--ink);
    margin: 24px 0 0;
    padding: 16px 20px;
}
.notice .btn { margin-top: 12px; }

/* Calculators */
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: -20px; }
.group {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(19, 35, 58, .06), 0 8px 24px rgba(19, 35, 58, .06);
    padding: 20px;
}
.group h2 { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.calc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    padding: 14px 16px;
    text-decoration: none;
    transition: border-color .15s, background-color .15s, transform .15s;
}
.calc + .calc { margin-top: 10px; }
.calc:hover, .calc:focus-visible { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); outline: none; }
.calc strong { display: block; font-size: 1.1rem; }
.calc small { display: block; color: var(--muted); font-size: .875rem; }
.calc .arrow { color: var(--brand); font-size: 1.25rem; flex: none; }

/* Side by side */
.compare {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-top: 24px;
}
.compare summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.compare summary::-webkit-details-marker { display: none; }
.compare summary::after { content: "+"; color: var(--brand); font-size: 1.4rem; line-height: 1; }
.compare[open] summary::after { content: "\2212"; }
.compare .body { border-top: 1px solid var(--line); padding: 16px 20px 20px; color: var(--muted); }
.compare .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Buttons and form controls */
.btn, .select {
    appearance: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-size: .925rem;
    font-weight: 500;
    min-height: 40px;
    padding: 8px 14px;
    text-align: center;
    text-decoration: none;
}
.btn:hover, .select:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}
.input { border: 1px solid var(--field-line); border-radius: 8px; font: inherit; min-height: 40px; padding: 8px 12px; }

/* Loan officer tools */
.tools {
    border-top: 1px solid var(--line);
    margin-top: 32px;
    padding-top: 20px;
}
.tools h2 { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.tools .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tools .hint { color: var(--muted); font-size: .82rem; margin-top: 8px; }

/* Sign-in card on the home page */
.auth {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(19, 35, 58, .06);
    margin: -20px auto 0;
    max-width: 440px;
    padding: 28px 28px 24px;
}
.auth h2 { font-size: 1.25rem; margin-bottom: 6px; }
.auth .lead { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.auth .field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.auth .field .input { font-weight: 400; width: 100%; }
/* Password box with the show / hide eye button inside its right end */
.pw-field { display: block; position: relative; }
.pw-field .input { padding-right: 44px; }
.pw-toggle {
    align-items: center; background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-flex;
    height: 34px; justify-content: center; position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 38px;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--brand); outline: none; }
.pw-toggle:focus-visible { box-shadow: 0 0 0 2px var(--brand-soft); }
.auth .hint { color: var(--muted); font-size: .82rem; font-weight: 400; }
.auth .check { align-items: center; display: flex; gap: 8px; font-size: .92rem; margin-bottom: 18px; }
.auth .check input { accent-color: var(--brand); height: 18px; width: 18px; }
.auth .btn-primary { width: 100%; }
.auth .alt { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; margin-top: 20px; padding-top: 16px; text-align: center; }
/* First visit (no password yet): the emailed link is the main action, not a footnote */
.auth.first-time .alt { border-top: 0; color: var(--ink); font-size: .95rem; line-height: 1.5; margin-top: 0; padding-top: 0; text-align: left; }
.auth.first-time .alt .btn-primary { margin-top: 16px; }
.auth .link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; font-weight: 600; padding: 4px; text-decoration: underline; }
.auth .field .input.code { font-family: Consolas, "Courier New", monospace; font-size: 1.5rem; letter-spacing: .3em; text-align: center; }
.auth .msg { border-radius: 8px; display: block; font-size: .9rem; margin-bottom: 16px; padding: 10px 12px; }
.auth .msg:empty { display: none; }
.auth .msg.bad { background: var(--alert-soft); color: var(--alert); }
.auth .msg.good { background: var(--brand-soft); color: var(--brand-dark); }
/* Anything marked hidden stays hidden, even where a rule below sets display (e.g. flex rows the script hides). */
[hidden] { display: none !important; }

/* Payment screen (subscription): two steps, plan + details, then order summary + Stripe's card form */
.auth.renew { max-width: 560px; padding: 28px 32px 24px; }
.auth.renew h2 { font-size: 1.4rem; letter-spacing: -.01em; }


.auth.renew .lead { margin-bottom: 20px; }
/* Plan and order-summary tables: one item per row, prices right-aligned */
.pay-table { border: 1px solid var(--line); border-collapse: separate; border-radius: 10px; border-spacing: 0; overflow: hidden; width: 100%; }
.pay-table th, .pay-table td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: middle; }
.pay-table tbody tr:last-child td { border-bottom: 0; }
.pay-table .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pay-table small { color: var(--muted); display: block; font-size: .8rem; font-weight: 400; }
.pay-table thead th { background: var(--bg); color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; padding-bottom: 8px; padding-top: 8px; text-transform: uppercase; }

.plan-table .pick { padding-right: 0; width: 34px; }
.plan-table input[type=radio] { accent-color: var(--brand); display: block; height: 18px; margin: 0; width: 18px; }
.plan-table tbody tr { cursor: pointer; transition: background .12s; }
.plan-table tbody tr:hover { background: var(--bg); }
.plan-table tbody tr:has(input:checked) { background: var(--brand-soft); }
.plan-table tbody tr:has(input:checked) td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.plan-table label { cursor: pointer; display: block; }
.plan-table td strong { font-weight: 700; }
.plan-table .num strong { font-size: 1.1rem; }

.renew-choice { align-items: center; cursor: pointer; display: flex; font-size: .92rem; gap: 10px; margin: 14px 0 18px; }
.renew-choice input { accent-color: var(--brand); flex: none; height: 18px; margin: 0; width: 18px; }
.renew-choice.locked { color: var(--muted); cursor: default; }
.terms-note { color: var(--muted); font-size: .82rem; line-height: 1.45; margin: 10px 0 0; text-align: center; }

.pay-form .renew-note { color: var(--muted); font-size: .82rem; margin: 8px 2px 18px; }

.btn-large { font-size: 1rem; min-height: 48px; width: 100%; }
.btn[disabled] { cursor: wait; opacity: .7; }
.back-link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; margin: 0 0 12px; padding: 0; }
.back-link:hover { text-decoration: underline; }
.pay-sub { font-size: .95rem; margin: 20px 0 10px; }
.pay-field { margin-bottom: 6px; min-height: 48px; }
.summary-table tfoot th, .summary-table tfoot td { background: var(--bg); border-bottom: 0; border-top: 1px solid var(--line); font-size: 1.05rem; font-weight: 700; }
.summary-table .discount { color: #1a7f45; }
.summary-table .pending { color: var(--muted); font-size: .85rem; font-weight: 400; }
#qqPayNow { margin-top: 18px; width: 100%; }
/* Renewing early: the dates and amounts to come (nothing today) */
.schedule-table thead th { background: var(--bg); color: var(--ink); font-size: .95rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.schedule-table tbody tr:first-child td { color: var(--muted); }
.not-now { align-items: center; display: flex; justify-content: center; margin-top: 10px; }
.renew .resume-card { color: var(--muted); font-size: .9rem; margin: 12px 2px 18px; }
.renew .link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; font-weight: 600; margin-left: 6px; padding: 0; }
.renew .link-btn:hover { text-decoration: underline; }
.renew .msg { display: block; margin: 0 0 14px; }

/* Payment confirmation, above the next step after paying */
.paid-note { align-items: flex-start; background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); display: flex; gap: 12px; margin: -20px auto 0; max-width: 440px; padding: 14px 18px; }
.paid-note + .auth { margin-top: 12px; }
.paid-note ~ .groups { margin-top: 16px; }   /* the menu cards normally tuck up into the header */
.paid-note strong { display: block; margin-bottom: 2px; }
.paid-note span { font-size: .9rem; }
.paid-tick { align-items: center; background: var(--brand); border-radius: 50%; color: #fff; display: flex; flex: none; font-size: .9rem; font-weight: 700; height: 26px; justify-content: center; width: 26px; }
.sr-only { clip: rect(0 0 0 0); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

.pay-form .msg { margin: 14px 0 0; }
.auth .secure-note { color: var(--muted); font-size: .8rem; margin-top: 16px; text-align: center; }
.auth .secure-note svg { margin-right: 4px; vertical-align: -2px; }

@media (max-width: 560px) {
    .auth.renew { padding: 22px 18px 18px; }
    .pay-table th, .pay-table td { padding: 10px 10px; }
}
.signed-in { color: var(--muted); font-size: .85rem; margin-top: 14px; }
.signed-in .link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* Footer */
.foot { align-items: center; color: var(--muted); display: flex; gap: 16px; justify-content: center; margin-top: 32px; }
.foot img { height: 40px; width: auto; }

@media (max-width: 640px) {
    .groups { grid-template-columns: 1fr; gap: 16px; }
    .hero { padding: 28px 16px 40px; }
    .tools .row > * { flex: 1 1 calc(50% - 8px); }
}

/* Dark mode switch, top right of the header. Saved with the site's settings, shared with the calculators. */
.theme-toggle {
    align-items: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    position: absolute;
    right: 16px;
    top: 14px;
    transition: background-color .15s;
    width: 40px;
}
.theme-toggle:hover, .theme-toggle:focus-visible { background: rgba(255, 255, 255, .26); outline: none; }
.theme-toggle .sun, html.dark .theme-toggle .moon { display: none; }
html.dark .theme-toggle .sun { display: inline; }
@media (max-width: 640px) {
    .theme-toggle { right: 12px; top: 10px; }
    .hero { padding-top: 58px; }   /* room for the switch above the text */
}

/* ---- Dark mode: the same page in dark colours (same tokens as CS/Calculator.css) ---- */
html.dark {
    --brand: #4d8dff;
    --brand-dark: #9cc0ff;     /* used for text, so lighter in the dark */
    --brand-soft: #1b2d4d;
    --ink: #e4ebf5;
    --muted: #97a6bc;
    --line: #2b3a52;
    --field-line: #51647f;
    --bg: #0d1420;
    --card: #162032;
    --alert: #ff7a6e;
    --alert-soft: #3b1f20;
    color-scheme: dark;        /* dark drop-down lists, checkboxes and scroll bars */
}
html.dark .hero { background: linear-gradient(135deg, #1a4fae 0%, #0e2f6e 100%); }
html.dark .group { box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25); }
html.dark .notice { border-color: #6b2c28; }
html.dark .summary-table .discount { color: #5fd08f; }
html.dark .input { background: #0f1828; color: var(--ink); }
html.dark .btn-primary, html.dark .btn-primary:hover { color: #fff; }
html.dark .btn-primary:hover { background: #2f6fe0; border-color: #2f6fe0; }
html.dark .foot img, html.dark .qq-foot img.qq-ehl { background: #fff; border-radius: 6px; padding: 3px; }   /* the logos are drawn for white paper */

/* "What's new" popup (App_Code/QQWhatsNew.vb): a card over a dimmed page. .wn-inline draws it in place (Admin's preview). */
.wn-backdrop { align-items: center; background: rgba(13, 20, 32, .55); display: flex; inset: 0; justify-content: center; padding: 16px; position: fixed; z-index: 1000; }
.wn-backdrop[hidden] { display: none; }
.wn-backdrop.wn-inline { border-radius: var(--radius); inset: auto; padding: 36px 16px; position: relative; z-index: auto; }
.wn-card { background: var(--card); border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); color: var(--ink); display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-width: 620px; overflow: hidden; text-align: left; width: 100%; }
.wn-inline .wn-card { max-height: none; }
.wn-head { align-items: center; background: linear-gradient(135deg, var(--brand-soft) 0%, var(--card) 70%); border-bottom: 1px solid var(--line); display: flex; gap: 16px; padding: 20px 24px 16px; }
.wn-head img { flex: none; height: 30px; width: auto; }
.wn-head h2 { font-size: 1.3rem; line-height: 1.25; margin: 0; }
.wn-head p { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
.wn-close { background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 1.6rem; line-height: 1; margin-left: auto; padding: 2px 10px; }
.wn-close:hover { background: var(--bg); color: var(--ink); }
.wn-body { overflow-y: auto; padding: 4px 24px; }
.wn-body section { border-bottom: 1px solid var(--line); padding: 14px 0; }
.wn-body section:last-child { border-bottom: 0; }
.wn-body h3 { color: var(--brand); font-size: .76rem; font-weight: 700; letter-spacing: .08em; margin: 0 0 8px; text-transform: uppercase; }
.wn-body ul { display: grid; gap: 7px; list-style: none; }
.wn-body li { font-size: .95rem; line-height: 1.45; padding-left: 18px; position: relative; }
.wn-body li::before { background: var(--brand); border-radius: 50%; content: ""; height: 7px; left: 2px; position: absolute; top: .6em; width: 7px; }
.wn-foot { align-items: center; background: var(--bg); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; padding: 14px 24px; }
.wn-note { color: var(--muted); font-size: .82rem; }
/* The slides (qq/whats-new.html) framed over the home page: QQWhatsNew.SlidesPopupHtml */
.wn-frame { border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); height: min(780px, calc(100vh - 32px)); overflow: hidden; width: min(960px, 100%); }
.wn-frame iframe { background: #fff; border: 0; display: block; height: 100%; width: 100%; }
.wn-logo-dark { display: none; }
html.dark .wn-logo-light { display: none; }
html.dark .wn-logo-dark { display: inline; }
html.dark .wn-backdrop { background: rgba(0, 0, 0, .6); }
@media (max-width: 520px) {
    .wn-head, .wn-body, .wn-foot { padding-left: 16px; padding-right: 16px; }
    .wn-foot .btn { width: 100%; }
}
