/* ============================================================
   RashScan — Auth modal, account avatar, dashboard, and small
   UX additions (HEIC placeholder, paywall trust row, toast
   actions, loading elapsed indicator).
   Uses the same design tokens as css/app.css / css/site.css.
   ============================================================ */

/* ---------- Auth nav button & avatar ---------- */

.auth-signin-btn { cursor: pointer; }

.auth-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sage, #8B7ED8);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.auth-avatar:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(46, 40, 84, 0.5); }

/* ---------- Auth modal ---------- */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(34, 29, 66, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.auth-overlay.open { display: flex; }

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--white, #fff);
    border-radius: 20px;
    padding: 30px 28px 24px;
    box-shadow: 0 24px 60px -20px rgba(46, 40, 84, 0.4);
    font-family: var(--font-body, 'Inter', system-ui, sans-serif);
    color: var(--ink, #2B2740);
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--cream, #F5F3FF);
    color: var(--muted, #5F5B75);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-close:hover { background: var(--sage-soft, #E9E4F8); color: var(--forest, #2E2854); }

.auth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display, 'Fraunces', Georgia, serif);
    font-weight: 600;
    font-size: 18px;
    color: var(--forest, #2E2854);
    margin-bottom: 14px;
}
.auth-brand img { border-radius: 7px; }

.auth-modal h2 {
    font-family: var(--font-display, 'Fraunces', Georgia, serif);
    font-size: 24px;
    color: var(--forest, #2E2854);
    margin: 0 0 4px;
}
.auth-sub { font-size: 13.5px; color: var(--muted, #5F5B75); margin: 0 0 18px; }

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: var(--cream, #F5F3FF);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 18px;
}
.auth-tabs button {
    border: none;
    background: transparent;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted, #5F5B75);
    cursor: pointer;
    font-family: inherit;
}
.auth-tabs button.active {
    background: var(--white, #fff);
    color: var(--forest, #2E2854);
    box-shadow: 0 2px 8px -2px rgba(46, 40, 84, 0.18);
}

.auth-modal form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--forest, #2E2854);
    margin: 12px 0 5px;
}
.auth-modal form input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--line, #E4E0F0);
    border-radius: 11px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--ink, #2B2740);
    background: var(--white, #fff);
}
.auth-modal form input:focus {
    outline: none;
    border-color: var(--sage, #8B7ED8);
    box-shadow: 0 0 0 3px rgba(139, 126, 216, 0.18);
}

.auth-error {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--coral-soft, #FBE7E9);
    color: var(--coral, #DC3545);
    font-size: 13px;
    line-height: 1.45;
}

.auth-submit {
    width: 100%;
    margin-top: 18px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: var(--sage, #8B7ED8);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.auth-submit:hover { background: var(--forest, #2E2854); }
.auth-submit:disabled { opacity: 0.55; cursor: default; transform: none; }

.auth-note {
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--faint, #908CA5);
    text-align: center;
    line-height: 1.5;
}

/* ---------- HEIC preview placeholder ---------- */

.heic-note {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 160px;
    padding: 22px;
    border-radius: 12px;
    background: var(--sage-mist, #F1EEFB);
    border: 1.5px dashed var(--sage, #8B7ED8);
    color: var(--forest, #2E2854);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

/* ---------- Paywall trust row ---------- */

.paywall-trust {
    margin: 14px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--forest, #2E2854);
    text-align: center;
}
.paywall-note a { color: var(--sage, #8B7ED8); text-decoration: none; }
.paywall-note a:hover { text-decoration: underline; }

/* ---------- Loading elapsed indicator ---------- */

.loading-elapsed {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted, #5F5B75);
    font-variant-numeric: tabular-nums;
}

/* ---------- Toast action button ---------- */

.toast-action {
    margin-left: 12px;
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--forest, #2E2854);
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.toast-action:hover { background: #fff; }

/* ---------- Chat upgrade prompt ---------- */

.chat-upgrade { flex-direction: column; align-items: flex-start; gap: 8px; }
.chat-upgrade-btn {
    border: none;
    border-radius: 9px;
    padding: 8px 14px;
    background: var(--sage, #8B7ED8);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.chat-upgrade-btn:hover { background: var(--forest, #2E2854); }

/* ============================================================
   Dashboard
   ============================================================ */

.dash-main {
    padding: 120px 0 70px;
    min-height: 60vh;
}

.dash-head { margin-bottom: 28px; }
.dash-head h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 6px; }
.dash-head p { color: var(--muted, #5F5B75); margin: 0; }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.dash-card {
    background: var(--white, #fff);
    border: 1px solid var(--line, #E4E0F0);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 14px 34px -22px rgba(46, 40, 84, 0.25);
}
.dash-card h2 {
    font-size: 19px;
    margin: 0 0 14px;
    color: var(--forest, #2E2854);
}

.dash-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--cream-deep, #ECE8FA);
    font-size: 14px;
}
.dash-row:last-child { border-bottom: none; }
.dash-row .dash-label { color: var(--muted, #5F5B75); }
.dash-row .dash-value { font-weight: 600; color: var(--ink, #2B2740); text-align: right; word-break: break-word; }

.dash-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.dash-badge.pro { background: var(--sage-soft, #E9E4F8); color: var(--forest, #2E2854); }
.dash-badge.free { background: var(--cream, #F5F3FF); color: var(--muted, #5F5B75); }

.dash-note {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--muted, #5F5B75);
    line-height: 1.55;
}
.dash-note a, .dash-card a.dash-link { color: var(--sage, #8B7ED8); text-decoration: none; font-weight: 600; }
.dash-note a:hover, .dash-card a.dash-link:hover { text-decoration: underline; }

.dash-section { margin-top: 34px; }
.dash-section > h2 { font-size: 22px; margin: 0 0 14px; color: var(--forest, #2E2854); }

.dash-history { display: flex; flex-direction: column; gap: 10px; }

.dash-history-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--white, #fff);
    border: 1px solid var(--line, #E4E0F0);
    border-radius: 14px;
    text-decoration: none;
    color: var(--ink, #2B2740);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.dash-history-row:hover { border-color: var(--sage, #8B7ED8); transform: translateY(-1px); }

.dash-history-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--cream-deep, #ECE8FA);
    flex-shrink: 0;
}
.dash-history-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--faint, #908CA5);
}

.dash-history-info { flex: 1; min-width: 0; }
.dash-history-info h3 {
    font-size: 15px;
    margin: 0 0 2px;
    font-family: var(--font-body, 'Inter', system-ui, sans-serif);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-history-info p { margin: 0; font-size: 12.5px; color: var(--muted, #5F5B75); }

.dash-severity {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}
.dash-severity.low { background: #E5F6EC; color: #1E7B3C; }
.dash-severity.medium { background: var(--amber-soft, #FCF3D7); color: #8a6d00; }
.dash-severity.high { background: var(--coral-soft, #FBE7E9); color: var(--coral, #DC3545); }

.dash-empty {
    padding: 30px 20px;
    text-align: center;
    border: 1.5px dashed var(--line, #E4E0F0);
    border-radius: 14px;
    color: var(--muted, #5F5B75);
    font-size: 14px;
    background: var(--white, #fff);
}
.dash-empty a { color: var(--sage, #8B7ED8); font-weight: 600; text-decoration: none; }
.dash-empty a:hover { text-decoration: underline; }

.dash-danger {
    border-color: var(--coral-soft, #FBE7E9);
    background: #FFFDFD;
}
.dash-danger h2 { color: var(--coral, #DC3545); }
.dash-danger-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 11px;
    border: 1.5px solid var(--line, #E4E0F0);
    background: var(--white, #fff);
    color: var(--forest, #2E2854);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.dash-btn:hover { border-color: var(--sage, #8B7ED8); }
.dash-btn.danger { color: var(--coral, #DC3545); border-color: var(--coral-soft, #FBE7E9); }
.dash-btn.danger:hover { background: var(--coral-soft, #FBE7E9); }

.dash-signin {
    max-width: 460px;
    margin: 0 auto;
    text-align: center;
}
.dash-signin .dash-btn { margin-top: 16px; }

@media (max-width: 640px) {
    .dash-main { padding-top: 100px; }
    .dash-row { flex-direction: column; gap: 2px; }
    .dash-row .dash-value { text-align: left; }
}
