/* Portal, admin and homeowner pages. Built on ui.css (tokens + components). */

/* ---- App shell ---------------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.78); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid rgba(230,233,239,.8); }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.logo .mark { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--brand-2), var(--brand) 60%, #047857); box-shadow: 0 4px 12px -4px rgba(5,150,105,.6); position: relative; }
.logo .mark::after { content: ""; position: absolute; inset: 8px 7px 7px 8px; border: 2.5px solid #fff; border-top-color: transparent; border-left-color: transparent; border-radius: 3px; transform: rotate(45deg) translate(-1px,-2px); width: 6px; height: 11px; }
.tabs { display: none; gap: 4px; margin-left: 8px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: .93rem; }
.tabs a:hover { background: var(--line-2); color: var(--ink); } .tabs a.on { background: var(--ink); color: #fff; }
.tabs a svg { width: 18px; height: 18px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.iconbtn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); font: 750 15px var(--font); cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: var(--line-2); }
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.bottombar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--faint); text-decoration: none; font-size: .7rem; font-weight: 650; }
.bottombar a.on { color: var(--brand); } .bottombar a.on svg { stroke-width: 2.3; }
body.app { padding-bottom: 84px; }
@media (min-width: 820px) { .tabs { display: flex; } .bottombar { display: none; } body.app { padding-bottom: 0; } }
main.wrap { padding-top: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; } .page-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { font-size: .74rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }

/* ---- Notices ---------------------------------------------------------------------------------- */
.flash, .notice { padding: 13px 16px; border-radius: 14px; margin: 0 0 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.flash.ok, .notice.ok { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.flash.err, .notice.err { background: var(--red-soft); color: #991b1b; border-color: #fecaca; }
.notice.info { background: var(--blue-soft); color: #1e3a8a; border-color: #bfdbfe; } .notice.gift { background: var(--violet-soft); color: #5b21b6; border-color: #ddd6fe; }
.devbar { background: #111827; color: #fde68a; font-size: .8rem; padding: 6px 12px; text-align: center; } .devbar a { color: #93c5fd; }

/* ---- Stats ------------------------------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-1); }
.stat b { display: block; font-size: 1.8rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; } .stat span { color: var(--muted); font-size: .86rem; }

/* ---- Lead list -------------------------------------------------------------------------------- */
.leads { display: grid; gap: 10px; }
.lead-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--sh-1); transition: transform .15s var(--ease), box-shadow .2s; }
.lead-row:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #34d399, #059669); }
.lead-row .t { font-weight: 700; } .lead-row .s { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.lead-row .r { display: grid; justify-items: end; gap: 6px; }

/* ---- Setup stepper ---------------------------------------------------------------------------- */
.setup-steps { display: grid; gap: 14px; }
.setup-step { padding: 0; overflow: hidden; }
.setup-step > header { display: flex; gap: 14px; align-items: center; padding: 18px 22px; cursor: pointer; }
.setup-step > header h2 { margin: 0; font-size: 1.08rem; } .setup-step > header p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.setup-step > header .n { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--line-2); color: var(--muted); }
.setup-step.done > header .n { background: var(--brand); color: #fff; } .setup-step.now > header .n { background: var(--ink); color: #fff; }
.setup-step > .body { padding: 0 22px 22px; border-top: 1px solid var(--line-2); padding-top: 18px; }
.setup-step:not(.open) > .body { display: none; }
.setup-step > header .chev { margin-left: auto; color: var(--faint); transition: transform .2s; } .setup-step.open > header .chev { transform: rotate(180deg); }
.phone-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.phone-row:last-child { border-bottom: 0; }

/* ---- Buy page --------------------------------------------------------------------------------- */
.buy-grid { display: grid; gap: 16px; } @media (min-width: 900px) { .buy-grid { grid-template-columns: 1.25fr 1fr; align-items: start; } .buy-grid .sticky { position: sticky; top: 86px; } }
.pack { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.pack:last-child { border-bottom: 0; } .pack .t { font-weight: 700; } .pack .s { font-size: .84rem; color: var(--muted); }
.pack.hot { background: linear-gradient(90deg, var(--brand-soft), transparent); margin: 0 -22px; padding: 14px 22px; border-radius: 12px; border-bottom: 0; }

/* ---- Order / copy fields ---------------------------------------------------------------------- */
.copyfield { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.copyfield + .copyfield { margin-top: 10px; } .copyfield .k { font-size: .78rem; color: var(--muted); font-weight: 650; } .copyfield .v { font-weight: 750; font-size: 1.05rem; word-break: break-all; }

/* ---- Lead page -------------------------------------------------------------------------------- */
.lead-hero { display: grid; gap: 6px; }
.quote { font-size: 1.12rem; line-height: 1.5; padding: 14px 16px; border-left: 4px solid var(--brand-2); background: var(--brand-soft); border-radius: 0 12px 12px 0; color: var(--brand-ink); }
.callbox { display: grid; gap: 10px; margin-top: 14px; }
.live { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: #1e3a8a; font-weight: 650; }
.live .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 0 rgba(37,99,235,.6); animation: pulse 1.4s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 12px rgba(37,99,235,0); } }
.windows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.windows .w { border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; font-size: .84rem; background: #fff; }
.windows .w b { display: block; font-size: .9rem; } .windows .w.done { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 22px; } .timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); } .timeline li:last-child::after { display: none; }
.timeline .when { font-size: .78rem; color: var(--muted); }
.outcomes { display: flex; flex-wrap: wrap; gap: 8px; }
.outcomes button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: 650 14px var(--font); cursor: pointer; }
.outcomes button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- Legacy pieces still used by admin and the homeowner page ------------------------------------ */
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.pill.green { background: var(--brand-soft); color: var(--brand-ink); } .pill.blue { background: var(--blue-soft); color: #1e40af; } .pill.yellow { background: var(--amber-soft); color: var(--amber); } .pill.gift { background: var(--violet-soft); color: var(--violet); } .pill.gray { background: var(--line-2); color: var(--ink-2); }
.btn.big { padding: 16px 22px; font-size: 17px; width: 100%; } .btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
pre.outbox { white-space: pre-wrap; background: #0b1220; color: #d1e7ff; padding: 10px; border-radius: 10px; font-size: .82rem; margin: 6px 0 0; }
.total b { font-size: 1.4rem; }

/* ---- Homeowner page (myrenoquote.com) — to be redesigned next ------------------------------------- */
.hp { background: #fff; } .hp header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.hp header .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; object-fit: cover; }
.hp .hero { padding: 28px 20px 8px; max-width: 620px; margin: 0 auto; } .hp .hero h1 { font-size: 1.75rem; }
.hp .rating { color: #b7791f; font-weight: 700; } .hp .formcard { max-width: 620px; margin: 0 auto 30px; padding: 0 20px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .choice button { padding: 18px 10px; border: 2px solid var(--line); background: #fff; border-radius: 14px; font: 650 16px var(--font); cursor: pointer; }
.choice button:hover, .choice button.on { border-color: var(--brand); background: var(--brand-soft); }
.hp .step { display: none; } .hp .step.on { display: block; } .err { color: var(--red); font-size: .92rem; margin-top: 8px; min-height: 1.2em; }
.matched { display: flex; gap: 12px; align-items: center; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; } .photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.consent { font-size: .82rem; color: var(--muted); margin-top: 10px; } .hp footer { padding: 20px; text-align: center; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); }
.hp-trust { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin: 10px 0; } .hidden { position: absolute; left: -9999px; }
.hp .big { font-size: 1.15rem; }

/* ---- Sign up / log in ------------------------------------------------------------------------- */
.auth-body { background: radial-gradient(1200px 600px at 10% -10%, #d1fae5 0%, transparent 60%), radial-gradient(900px 500px at 110% 10%, #dbeafe 0%, transparent 55%), var(--bg); min-height: 100vh; }
.auth { max-width: 1040px; margin: 0 auto; padding: 28px 20px 60px; display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .auth { grid-template-columns: 1fr 1.05fr; padding-top: 64px; } }
.auth-side h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); }
.auth-card { max-width: 520px; width: 100%; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { padding-left: 30px; position: relative; color: var(--ink-2); }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.howto { padding-left: 20px; margin: 0 0 16px; display: grid; gap: 6px; color: var(--ink-2); }

/* Mobile pay bar on the buy page (sits above the bottom tabs). */
.paybar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 39; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 18px; background: var(--ink); color: #fff; box-shadow: var(--sh-3); }
.paybar .muted { color: #94a3b8; } .paybar b { font-size: 1.25rem; } .paybar .btn { --b: var(--brand-2); }
body.app:has(.paybar) { padding-bottom: 160px; }
@media (min-width: 900px) { .paybar { display: none; } body.app:has(.paybar) { padding-bottom: 0; } }
.copyfield .v.small { font-size: .9rem; }
.hp .progress > i { width: 0; }
