/* ============================================
   ScanDoc Expert — Auth Pages CSS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
    --bg-color:     #0a0b10;
    --card-bg:      rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary:      #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.4);
    --secondary:    #818cf8;
    --accents:      #c084fc;
    --text-main:    #f8fafc;
    --text-muted:   #94a3b8;
    --radius:       16px;
    --transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --danger:       #ef4444;
    --success:      #22c55e;
}

*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Animated Background ─────────────────── */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.auth-bg-orb-1 {
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -20%; right: -10%;
    animation: orbFloat1 12s infinite alternate ease-in-out;
}

.auth-bg-orb-2 {
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, var(--accents) 0%, transparent 70%);
    bottom: -10%; left: -5%;
    animation: orbFloat2 15s infinite alternate ease-in-out;
}

@keyframes orbFloat1 { from { transform: translate(0,0) scale(1); } to { transform: translate(-5%,8%) scale(1.1); } }
@keyframes orbFloat2 { from { transform: translate(0,0) scale(1); } to { transform: translate(5%,-5%) scale(1.05); } }

/* ─── Header ──────────────────────────────── */
.auth-header {
    position: relative;
    z-index: 10;
    padding: 1.5rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    background: rgba(10,11,16,0.7);
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.8px;
    cursor: pointer;
}

.auth-header-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}
.auth-header-link span {
    color: var(--secondary);
    font-weight: 600;
}
.auth-header-link:hover { color: var(--text-main); }

/* ─── Auth Page Layout ────────────────────── */
.auth-layout {
    position: relative;
    z-index: 5;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

/* ─── Auth Card ───────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(14, 15, 22, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 25px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    animation: cardIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.auth-card-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accents));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 30px var(--primary-glow);
}

.auth-card h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, #fff, var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ─── Google Button ───────────────────────── */
.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.btn-google:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn-google svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
}

/* ─── Divider ─────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* ─── Form Fields ─────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.field-input:focus {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.07);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}

.field-input::placeholder { color: rgba(148, 163, 184, 0.5); }

.field-error {
    font-size: 0.8rem;
    color: var(--danger);
    display: none;
}
.field-error.visible { display: block; }

/* ─── Password Toggle ─────────────────────── */
.field-input-wrap {
    position: relative;
}
.field-input-wrap .field-input { padding-right: 3rem; }
.toggle-password {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    padding: 0.2rem;
}
.toggle-password:hover { color: var(--text-main); }

/* ─── Submit Button ───────────────────────── */
.btn-submit {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--secondary), var(--accents));
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-submit:hover::before { opacity: 1; }
.btn-submit span { position: relative; z-index: 1; }
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 30px var(--primary-glow); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ─── Loading State ───────────────────────── */
.btn-submit .btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: relative; z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .btn-spinner { display: inline-block; }

/* ─── Alert Banner ────────────────────────── */
.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    animation: alertIn 0.3s ease-out;
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.auth-alert.visible { display: flex; }
.auth-alert.error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.auth-alert.success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }

/* ─── Footer Link ─────────────────────────── */
.auth-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-footer-text a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}
.auth-footer-text a:hover { color: var(--primary); text-decoration: underline; }

/* ─── Forgot Password ─────────────────────── */
.forgot-link {
    text-align: right;
    font-size: 0.82rem;
}
.forgot-link a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}
.forgot-link a:hover { color: var(--secondary); }

/* ─── Password Strength ───────────────────── */
.password-strength {
    margin-top: 0.4rem;
}
.strength-bar {
    height: 3px;
    background: var(--glass-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}
.strength-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: all 0.4s ease;
    width: 0;
}
.strength-label { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Dashboard ───────────────────────────── */
.dash-layout {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.dash-greeting {
    margin-bottom: 2.5rem;
}
.dash-greeting h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}
.dash-greeting p { color: var(--text-muted); font-size: 0.95rem; }

/* Dashboard Grid */
.dash-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
}

/* Stat Cards */
.dash-card {
    background: rgba(14, 15, 22, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}
.dash-card:hover {
    border-color: rgba(79,70,229,0.3);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* Profile Card */
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accents));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.profile-email {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* Plan Badge */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.plan-badge.free {
    background: rgba(148,163,184,0.1);
    border: 1px solid rgba(148,163,184,0.2);
    color: var(--text-muted);
}
.plan-badge.pro {
    background: linear-gradient(135deg, rgba(79,70,229,0.2), rgba(192,132,252,0.2));
    border: 1px solid rgba(79,70,229,0.4);
    color: var(--secondary);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.btn-outline {
    width: 100%;
    padding: 0.7rem 1rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(79,70,229,0.08);
}
.btn-outline.danger:hover {
    border-color: var(--danger);
    color: #fca5a5;
    background: rgba(239,68,68,0.08);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 600px) { .stats-row { grid-template-columns: 1fr 1fr; } }

.stat-card {
    background: rgba(14, 15, 22, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem 1.4rem;
    backdrop-filter: blur(20px);
}
.stat-icon { font-size: 1.4rem; margin-bottom: 0.5rem; }
.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.1rem;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

/* History Table */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table th {
    text-align: left;
    padding: 0.65rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}
.history-table td {
    padding: 0.85rem 0.8rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: rgba(255,255,255,0.02); }

.risk-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 26px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
}
.risk-pill.low    { background: rgba(34,197,94,0.15);  color: #4ade80; }
.risk-pill.medium { background: rgba(245,158,11,0.15); color: #fbbf24; }
.risk-pill.high   { background: rgba(239,68,68,0.15);  color: #f87171; }

.doc-type-tag {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(79,70,229,0.1);
    border: 1px solid rgba(79,70,229,0.2);
    color: var(--secondary);
}

.empty-history {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-history .empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-history p { font-size: 0.9rem; }
.empty-history a {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: 6px;
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Responsive ──────────────────────────── */
@media (max-width: 768px) {
    .auth-header { padding: 1rem 1.25rem; }
    .auth-card { padding: 1.75rem 1.5rem; }
    .dash-layout { margin: 1.5rem auto; }
    .dash-greeting h1 { font-size: 1.6rem; }
    .history-table th:nth-child(3),
    .history-table td:nth-child(3) { display: none; }
}
