/* Seacoast Realty AI - User Portal CSS (Dark Only) */
:root {
    --bg: #0f172a;
    --card: #1e293b;
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --bd: #334155;
    --brand: #0ea5e9;
    --success: #22c55e;
    --danger: #ef4444;
    --warn: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--bd);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.logo, .back-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link svg { flex-shrink: 0; }
/* Never shrinks. On a small phone the right-hand buttons would otherwise push
   the back arrow off the header, stranding the user with no way out of the
   page. The buttons give up their labels first. */
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.header-icon { color: var(--muted); transition: color 0.2s; display: flex; align-items: center; }
.header-icon:hover { color: var(--ink); }
/* Truncate rather than collide with the Chat button on narrow windows. */
.header-title {
    font-size: 18px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.back-link {
    color: var(--muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.back-link:hover { color: var(--ink); }
.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}
.user-name { font-weight: 500; }

/* Buttons */
.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--bd);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:hover { background: var(--bg); }
.btn.pri { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.pri:hover { background: #0284c7; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.xs { padding: 2px 6px; font-size: 11px; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.container.narrow { max-width: 800px; }
.page-title { font-size: 24px; font-weight: 600; margin-bottom: 24px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; }
.breadcrumb a { color: var(--brand); text-decoration: none; }

/* Cards */
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--bd);
    position: relative;
    transition: border-color .15s, background .15s, transform .15s;
    /* Column so the description absorbs uneven row height and every action
       link in a row lands on the same baseline instead of floating mid-card. */
    display: flex;
    flex-direction: column;
}
/* Only the description of a card that actually has an action absorbs the slack.
   Voice Access has no link and would otherwise get a gap under its text. */
.card:has(.card-link) > p:first-of-type { flex: 1; }
.card .card-link { margin-top: auto; align-self: flex-start; }
/* The secondary link shares the action row rather than starting a new one. */
.card .card-link + .card-sub-link { margin-top: 10px; }
/* Whole-card click target. The overlay belongs to the real <a>, so the link
   keeps its href, keyboard focus, and open-in-new-tab, and no JS is involved.
   Cards without a .card-link (Voice Access) are untouched and stay inert. */
.card:has(.card-link) { cursor: pointer; }
.card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}
.card:has(.card-link):hover {
    border-color: var(--brand);
    background: rgba(14, 165, 233, 0.06);
    transform: translateY(-2px);
}
.card:has(.card-link):hover .card-link { text-decoration: underline; }
/* Keyboard users get the same outline the mouse gets a hover for. */
.card:has(.card-link:focus-visible) { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: 2px; }
.card-link:focus-visible { outline: none; }
/* Any real control inside a card must sit above the overlay to stay clickable.
   Card body text is not selectable once the overlay covers it, which is the
   accepted trade for a whole-card target. */
.card a:not(.card-link), .card button, .card input, .card select { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) {
    .card, .card:has(.card-link):hover { transition: none; transform: none; }
}
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
/* Section headings. Sentence case at normal weight, deliberately not the
   small-caps letter-spaced kicker: that pattern dates a UI fast. */
.section-head {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin: 40px 0 4px;
}
.cards + .section-head { margin-top: 44px; }
.section-head:first-of-type { margin-top: 0; }
.section-sub {
    color: var(--muted);
    font-size: 13.5px;
    margin: 0 0 16px;
}
.section-head + .cards { margin-top: 16px; }
.card h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.card h2 svg { color: var(--brand); }
.card p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.card-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); text-decoration: none; font-weight: 500; font-size: 14px; }
.card-link:hover { text-decoration: underline; }
/* Secondary destination inside a card whose primary action is the whole card. */
.card-sub-link { display: inline-block; margin-left: 16px; color: var(--muted); text-decoration: none; font-size: 13px; }
.card-sub-link:hover { color: var(--ink); text-decoration: underline; }
.settings-card {
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bd);
}

/* Messages / Alerts */
.message, .alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}
.message.success, .alert.success { background: #14532d; color: #86efac; }
.message.error, .alert.error { background: #450a0a; color: #fca5a5; }
.message.warning, .alert.warning { background: #451a03; color: #fcd34d; }
.msg-ok { background: #14532d; color: #86efac; padding: 14px 18px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }
.msg-err { background: #450a0a; color: #fca5a5; padding: 14px 18px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }

/* Login */
.login-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 32px;
    width: 100%;
    max-width: 400px;
}
.login-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.login-header h1 { font-size: 24px; font-weight: 600; }
.login-error { background: #450a0a; color: #fca5a5; padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.login-timeout { background: #451a03; color: #fcd34d; padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.btn-login {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-login:hover { background: #0284c7; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--bd);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }

/* General form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
textarea,
select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--bd);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    width: 100%;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Password toggle */
.password-wrapper { position: relative; }
.password-wrapper .form-input, .password-wrapper input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--muted);
}
.password-toggle:hover { color: var(--ink); }

/* Voice Box */
.voice-box { background: var(--bg); border: 1px solid var(--bd); border-radius: 8px; padding: 16px; margin-top: 8px; }
/* Now an <a>, so it needs block layout and its own link states back. */
.voice-number { display: block; font-size: 24px; font-weight: 600; color: var(--brand); margin-bottom: 8px; text-decoration: none; }
a.voice-number:hover { text-decoration: underline; }
a.voice-number:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.voice-hint { font-size: 13px; color: var(--muted); }

/* Status */
.status-row { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.green { background: var(--success); }
.status-dot.red { background: var(--danger); }
.status-dot.yellow { background: var(--warn); }

/* Standalone page (login/forgot/reset) */
.page-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.standalone-card {
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.standalone-card h1 { margin: 0 0 8px 0; font-size: 26px; font-weight: 600; text-align: center; }
.standalone-card .subtitle { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.standalone-card .back-link-center { text-align: center; margin-top: 20px; }
.standalone-card .back-link-center a { color: var(--muted); text-decoration: none; font-size: 14px; }
.standalone-card .back-link-center a:hover { color: var(--ink); }
.standalone-card .btn-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
}
.standalone-card .btn-submit:hover { background: #0284c7; }
.standalone-card label { display: block; margin-bottom: 20px; }
.standalone-card input[type="email"],
.standalone-card input[type="password"] { padding: 14px 16px; font-size: 15px; border-radius: 8px; }

/* Footer */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    margin-top: 48px;
    border-top: 1px solid var(--bd);
    color: var(--muted);
    font-size: 13px;
    width: 100%;
}

/* Chat button in header */
.btn-chat {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
}
.btn-chat:hover {
    background: var(--brand-hover, #1d4ed8) !important;
    border-color: var(--brand-hover, #1d4ed8) !important;
}

/* Calendar quick-link. Shares the Chat button's shape but not its fill: two
   identical brand-blue buttons split the attention the Chat button needs. */
.btn-quiet {
    background: transparent;
    color: var(--ink);
    border-color: var(--bd);
}
.btn-quiet:hover { background: var(--bg); border-color: var(--muted); }

/* Chat is the header's only accent, so give it a little more presence than the
   neutral buttons beside it. */
.btn-chat { font-weight: 600; padding: 9px 18px; }

/* Hide floating chat bubble — button is in the header */
body #vb4-container #vb4-toggle { display: none !important; visibility: hidden !important; }

/* Responsive */
/* Shed the header's optional text before anything can collide with the Chat
   button: the signed-in name first, then the page title. */
@media (max-width: 900px) {
    .header-right { gap: 10px; }
    .user-name { display: none; }
}
@media (max-width: 700px) {
    .header-title { display: none; }
}
@media (max-width: 600px) {
    .header { padding: 12px 16px; }
    /* Drop the word and keep the arrow. Letting it ellipsis instead produced
       "Dasl", which reads as broken rather than compact. */
    .back-label { display: none; }
    .back-link { gap: 0; }
    .container { padding: 24px 16px; }
    .cards { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* iPhone SE / mini territory. Chat and Calendar become icon-only and the avatar
   goes, so the back arrow and Sign Out both survive at 320px. */
@media (max-width: 480px) {
    .header { padding: 12px 12px; gap: 8px; }
    .header-right { gap: 8px; }
    .btn-label { display: none; }
    .btn-chat { padding: 8px 10px; }
    .user-avatar { display: none; }
    .cards { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* Dead-integration notice under the header. Amber, not red: it is an action
   item, not a failure the agent caused. */
.conn-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    font-size: 13.5px;
    line-height: 1.4;
}
.conn-alert svg { flex-shrink: 0; }
.conn-alert span { flex: 1; min-width: 0; }
.conn-alert a {
    flex-shrink: 0;
    color: #fbbf24;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 999px;
    padding: 4px 14px;
}
.conn-alert a:hover { background: rgba(245, 158, 11, 0.18); }
@media (max-width: 600px) {
    .conn-alert { padding: 10px 14px; font-size: 12.5px; }
}

/* Ask bar: the dashboard's primary invitation to use the assistant. Sits above
   the card grid so the first thing on the page is a place to start talking. */
.askbar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 12px;
    padding: 6px 6px 6px 16px;
    margin: 0 0 12px;
    transition: border-color .15s, box-shadow .15s;
}
.askbar:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.askbar-icon { color: var(--brand); flex-shrink: 0; }
.askbar-input {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: none;
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    padding: 12px 0;
}
.askbar-input::placeholder { color: var(--muted); }
.askbar-go { flex-shrink: 0; padding: 10px 20px; font-weight: 600; }
.askbar-busy .askbar-go { opacity: .6; pointer-events: none; }

.ask-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.ask-chips-label { color: var(--muted); font-size: 13px; }
.ask-chip {
    background: none;
    border: 1px solid var(--bd);
    border-radius: 999px;
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.ask-chip:hover { color: var(--brand); border-color: var(--brand); background: rgba(14, 165, 233, 0.08); }
@media (max-width: 600px) {
    .askbar { padding-left: 12px; gap: 8px; }
    .askbar-icon { display: none; }
    .askbar-input { font-size: 16px; }  /* 16px stops iOS zooming on focus */
    .ask-chips { margin-bottom: 24px; }
}
