/* ========================================
   SAMPRITI — Authentication Pages
   Premium Dark Theme
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --auth-bg: #06061a;
    --auth-bg2: #0c0c1d;
    --auth-surface: rgba(255,255,255,0.04);
    --auth-surface-hover: rgba(255,255,255,0.07);
    --auth-border: rgba(255,255,255,0.08);
    --auth-border-focus: rgba(232,168,56,0.4);
    --auth-text: #f0eef6;
    --auth-text-sec: rgba(240,238,246,0.6);
    --auth-text-muted: rgba(240,238,246,0.3);
    --auth-gold: #e8a838;
    --auth-orange: #e8752e;
    --auth-error: #ff6b6b;
    --auth-success: #5ce1e6;
    --auth-gradient: linear-gradient(135deg, #e8a838, #e8752e);
    --auth-gradient-subtle: linear-gradient(135deg, rgba(232,168,56,0.15), rgba(232,117,46,0.08));
    --auth-font-display: 'Outfit', 'Newsreader', sans-serif;
    --auth-font-body: 'Space Grotesk', 'Manrope', sans-serif;
    --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --auth-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --auth-radius: 16px;
}

/* === Base === */
.auth-page {
    font-family: var(--auth-font-body);
    background: var(--auth-bg);
    color: var(--auth-text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; margin: 0; padding: 0; }
.auth-page ::selection { background: rgba(232,168,56,0.3); color: #fff; }

/* === Background Effects === */
.auth-bg-orb {
    position: fixed; border-radius: 50%; filter: blur(120px);
    pointer-events: none; z-index: 0; will-change: transform;
}
.auth-bg-orb--1 { width: 500px; height: 500px; background: rgba(232,168,56,0.12); top: -10%; right: -8%; animation: authOrb1 20s ease-in-out infinite; }
.auth-bg-orb--2 { width: 400px; height: 400px; background: rgba(232,117,46,0.08); bottom: -15%; left: -8%; animation: authOrb2 25s ease-in-out infinite; }
.auth-bg-orb--3 { width: 300px; height: 300px; background: rgba(138,100,255,0.06); top: 50%; left: 50%; transform: translate(-50%,-50%); animation: authOrb3 18s ease-in-out infinite; }

@keyframes authOrb1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-40px,60px) scale(1.1)} }
@keyframes authOrb2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(50px,-40px) scale(1.08)} }
@keyframes authOrb3 { 0%,100%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-50%,-50%) translate(30px,-30px) scale(1.12)} }

/* === Layout === */
.auth-layout {
    display: flex; min-height: 100vh; position: relative; z-index: 1;
}
.auth-hero {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 3rem; position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(232,168,56,0.05), rgba(6,6,26,0.95));
}
.auth-hero::before {
    content: ''; position: absolute; inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="g" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="1" cy="1" r="0.5" fill="rgba(232,168,56,0.08)"/></pattern></defs><rect fill="url(%23g)" width="100" height="100"/></svg>');
    opacity: 0.5;
}
.auth-hero-content { position: relative; z-index: 1; text-align: center; max-width: 400px; }
.auth-hero-logo {
    width: 80px; height: 80px; border-radius: 50%; border: 2px solid rgba(232,168,56,0.3);
    box-shadow: 0 0 40px rgba(232,168,56,0.15); margin: 0 auto 1.5rem;
    animation: authLogoFloat 6s ease-in-out infinite;
}
@keyframes authLogoFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.auth-hero-title {
    font-family: var(--auth-font-display); font-size: 2.5rem; font-weight: 800;
    letter-spacing: 6px; margin-bottom: 0.75rem;
    background: var(--auth-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.auth-hero-sub {
    font-size: 0.85rem; color: var(--auth-text-sec); letter-spacing: 3px;
    text-transform: uppercase; font-weight: 400;
}
.auth-hero-tagline {
    margin-top: 2rem; font-size: 0.8rem; color: var(--auth-text-muted);
    line-height: 1.7; font-style: italic;
}

/* Form Panel */
.auth-panel {
    width: 520px; min-width: 420px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 3rem;
    position: relative; background: rgba(12,12,29,0.6);
    border-left: 1px solid var(--auth-border);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

/* === Card === */
.auth-card {
    width: 100%; max-width: 400px;
    animation: authCardIn 0.7s var(--auth-ease) both;
}
@keyframes authCardIn { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }

.auth-card-header { text-align: center; margin-bottom: 2rem; }
.auth-card-header h2 {
    font-family: var(--auth-font-display); font-size: 1.75rem; font-weight: 700;
    color: var(--auth-text); margin-bottom: 0.5rem;
}
.auth-card-header p { font-size: 0.85rem; color: var(--auth-text-sec); }

/* === Tabs === */
.auth-tabs {
    display: flex; background: var(--auth-surface); border-radius: 12px;
    padding: 4px; margin-bottom: 2rem; position: relative;
}
.auth-tab {
    flex: 1; padding: 0.7rem 1rem; text-align: center; font-size: 0.85rem;
    font-weight: 600; color: var(--auth-text-sec); cursor: pointer;
    border: none; background: none; border-radius: 10px;
    transition: all 0.3s var(--auth-ease); position: relative; z-index: 1;
    font-family: var(--auth-font-body); letter-spacing: 0.5px;
}
.auth-tab.active { color: var(--auth-bg); }
.auth-tab-indicator {
    position: absolute; top: 4px; bottom: 4px; width: calc(50% - 4px); left: 4px;
    background: var(--auth-gradient); border-radius: 10px;
    transition: transform 0.35s var(--auth-ease);
    box-shadow: 0 2px 12px rgba(232,168,56,0.3);
}
.auth-tabs[data-active="signup"] .auth-tab-indicator { transform: translateX(100%); }

/* === Form === */
.auth-form { display: flex; flex-direction: column; gap: 1.15rem; }
.auth-form[hidden] { display: none; }

.auth-field { position: relative; }
.auth-field label {
    display: block; font-size: 0.75rem; font-weight: 600; color: var(--auth-text-sec);
    margin-bottom: 0.4rem; letter-spacing: 0.5px; text-transform: uppercase;
}
.auth-input {
    width: 100%; padding: 0.85rem 1rem; font-size: 0.95rem;
    font-family: var(--auth-font-body); color: var(--auth-text);
    background: var(--auth-surface); border: 1px solid var(--auth-border);
    border-radius: 12px; outline: none;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.auth-input::placeholder { color: var(--auth-text-muted); }
.auth-input:focus {
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px rgba(232,168,56,0.1), 0 4px 20px rgba(232,168,56,0.08);
    background: rgba(255,255,255,0.06);
}
.auth-input.error { border-color: var(--auth-error); box-shadow: 0 0 0 3px rgba(255,107,107,0.1); }

/* Password toggle */
.auth-pw-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(25%);
    background: none; border: none; color: var(--auth-text-muted);
    cursor: pointer; font-size: 1.1rem; padding: 4px;
    transition: color 0.2s;
}
.auth-pw-toggle:hover { color: var(--auth-text-sec); }

/* Password strength */
.auth-pw-strength { height: 3px; border-radius: 2px; background: var(--auth-border); margin-top: 0.4rem; overflow: hidden; }
.auth-pw-strength-bar { height: 100%; width: 0; border-radius: 2px; transition: width 0.4s var(--auth-ease), background 0.4s; }
.auth-pw-strength-bar.weak { width: 33%; background: var(--auth-error); }
.auth-pw-strength-bar.medium { width: 66%; background: #f0a500; }
.auth-pw-strength-bar.strong { width: 100%; background: var(--auth-success); }
.auth-pw-hint { font-size: 0.7rem; color: var(--auth-text-muted); margin-top: 0.3rem; }

/* Remember me / Forgot */
.auth-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.8rem;
}
.auth-remember { display: flex; align-items: center; gap: 0.5rem; color: var(--auth-text-sec); cursor: pointer; }
.auth-remember input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--auth-gold); cursor: pointer;
    border-radius: 4px;
}
.auth-forgot {
    color: var(--auth-gold); text-decoration: none; font-weight: 500;
    transition: color 0.2s; border: none; background: none; cursor: pointer;
    font-family: var(--auth-font-body); font-size: 0.8rem;
}
.auth-forgot:hover { color: var(--auth-orange); text-decoration: underline; }

/* === Buttons === */
.auth-btn {
    width: 100%; padding: 0.9rem 1.5rem; font-size: 0.95rem; font-weight: 700;
    font-family: var(--auth-font-body); border: none; border-radius: 12px;
    cursor: pointer; position: relative; overflow: hidden;
    transition: all 0.3s var(--auth-ease); letter-spacing: 0.5px;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.auth-btn--primary {
    background: var(--auth-gradient); color: #fff;
    box-shadow: 0 4px 20px rgba(232,168,56,0.25);
}
.auth-btn--primary:hover {
    box-shadow: 0 6px 30px rgba(232,168,56,0.35); transform: translateY(-1px);
}
.auth-btn--primary:active { transform: translateY(0) scale(0.98); }
.auth-btn--primary::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0; transition: opacity 0.3s;
}
.auth-btn--primary:hover::after { opacity: 1; }

/* Loading state */
.auth-btn.loading { pointer-events: none; opacity: 0.8; }
.auth-btn.loading .auth-btn-text { opacity: 0; }
.auth-btn-spinner {
    display: none; position: absolute; width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: authSpin 0.6s linear infinite;
}
.auth-btn.loading .auth-btn-spinner { display: block; }
@keyframes authSpin { to { transform: rotate(360deg); } }

/* === Divider === */
.auth-divider {
    display: flex; align-items: center; gap: 1rem; margin: 0.25rem 0;
    font-size: 0.75rem; color: var(--auth-text-muted); text-transform: uppercase;
    letter-spacing: 1px;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--auth-border), transparent);
}

/* === Social Buttons === */
.auth-social-group { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-btn--social {
    background: var(--auth-surface); color: var(--auth-text);
    border: 1px solid var(--auth-border); font-weight: 500;
}
.auth-btn--social:hover {
    background: var(--auth-surface-hover); border-color: rgba(255,255,255,0.12);
    transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.auth-btn--social svg { width: 20px; height: 20px; flex-shrink: 0; }

/* === Messages === */
.auth-msg {
    padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.82rem;
    font-weight: 500; display: none; align-items: center; gap: 0.5rem;
    animation: authMsgIn 0.4s var(--auth-spring);
}
.auth-msg.show { display: flex; }
.auth-msg--error { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.2); color: var(--auth-error); }
.auth-msg--success { background: rgba(92,225,230,0.1); border: 1px solid rgba(92,225,230,0.2); color: var(--auth-success); }
@keyframes authMsgIn { from{opacity:0;transform:translateY(-8px) scale(0.97)} to{opacity:1;transform:translateY(0) scale(1)} }

/* === Forgot Password Modal === */
.auth-modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px); z-index: 1000;
    align-items: center; justify-content: center; padding: 1.5rem;
}
.auth-modal-overlay.show { display: flex; }
.auth-modal {
    background: var(--auth-bg2); border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius); padding: 2rem; max-width: 420px; width: 100%;
    animation: authModalIn 0.4s var(--auth-spring);
}
@keyframes authModalIn { from{opacity:0;transform:scale(0.92) translateY(20px)} to{opacity:1;transform:scale(1) translateY(0)} }
.auth-modal h3 {
    font-family: var(--auth-font-display); font-size: 1.25rem; font-weight: 700;
    margin-bottom: 0.5rem;
}
.auth-modal p { font-size: 0.82rem; color: var(--auth-text-sec); margin-bottom: 1.25rem; line-height: 1.6; }
.auth-modal-close {
    position: absolute; top: 1rem; right: 1rem; background: none; border: none;
    color: var(--auth-text-muted); cursor: pointer; font-size: 1.2rem;
    transition: color 0.2s;
}
.auth-modal-close:hover { color: var(--auth-text); }

/* === Email Verification Screen === */
.auth-verify {
    text-align: center; padding: 2rem 0;
    animation: authCardIn 0.6s var(--auth-ease);
}
.auth-verify-icon {
    font-size: 3.5rem; margin-bottom: 1.5rem;
    animation: authVerifyPulse 2s ease-in-out infinite;
}
@keyframes authVerifyPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.auth-verify h2 {
    font-family: var(--auth-font-display); font-size: 1.5rem; font-weight: 700;
    margin-bottom: 0.75rem;
}
.auth-verify p { font-size: 0.85rem; color: var(--auth-text-sec); line-height: 1.7; margin-bottom: 1.5rem; }

/* === Profile Page === */
.profile-container {
    max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem;
    position: relative; z-index: 1;
}
.profile-back {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: var(--auth-text-sec); text-decoration: none; font-size: 0.82rem;
    font-weight: 500; margin-bottom: 2rem; transition: color 0.2s;
}
.profile-back:hover { color: var(--auth-gold); }

.profile-header {
    display: flex; align-items: center; gap: 1.5rem; padding: 2rem;
    background: var(--auth-surface); border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius); margin-bottom: 1.5rem;
    animation: authCardIn 0.5s var(--auth-ease);
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar {
    width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(232,168,56,0.3);
    box-shadow: 0 0 30px rgba(232,168,56,0.1);
}
.profile-avatar-fallback {
    width: 90px; height: 90px; border-radius: 50%;
    background: var(--auth-gradient); display: flex; align-items: center;
    justify-content: center; font-size: 2rem; font-weight: 800;
    color: #fff; font-family: var(--auth-font-display);
}
.profile-avatar-edit {
    position: absolute; bottom: 0; right: 0; width: 28px; height: 28px;
    border-radius: 50%; background: var(--auth-gold); border: 2px solid var(--auth-bg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.75rem; color: #fff;
    transition: transform 0.2s var(--auth-spring);
}
.profile-avatar-edit:hover { transform: scale(1.1); }

.profile-info { flex: 1; min-width: 0; }
.profile-name {
    font-family: var(--auth-font-display); font-size: 1.5rem; font-weight: 700;
    margin-bottom: 0.25rem;
}
.profile-email { font-size: 0.85rem; color: var(--auth-text-sec); margin-bottom: 0.5rem; }
.profile-badge {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.75rem;
    border-radius: 20px; font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.profile-badge--verified { background: rgba(92,225,230,0.12); color: var(--auth-success); border: 1px solid rgba(92,225,230,0.2); }
.profile-badge--unverified { background: rgba(255,107,107,0.1); color: var(--auth-error); border: 1px solid rgba(255,107,107,0.15); }

/* Profile Cards */
.profile-card {
    background: var(--auth-surface); border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius); padding: 1.75rem; margin-bottom: 1.25rem;
    animation: authCardIn 0.5s var(--auth-ease) both;
}
.profile-card:nth-child(2) { animation-delay: 0.1s; }
.profile-card:nth-child(3) { animation-delay: 0.2s; }
.profile-card h3 {
    font-family: var(--auth-font-display); font-size: 1.1rem; font-weight: 700;
    margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.profile-card h3 .material-symbols-outlined { font-size: 1.2rem; color: var(--auth-gold); }

.profile-field {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 0; border-bottom: 1px solid var(--auth-border);
}
.profile-field:last-child { border-bottom: none; }
.profile-field-label { font-size: 0.8rem; color: var(--auth-text-sec); font-weight: 500; min-width: 120px; }
.profile-field-value { font-size: 0.9rem; color: var(--auth-text); flex: 1; text-align: right; }
.profile-field-edit {
    margin-left: 0.75rem; background: none; border: none; color: var(--auth-gold);
    cursor: pointer; font-size: 0.8rem; font-weight: 600;
    font-family: var(--auth-font-body); transition: color 0.2s;
}
.profile-field-edit:hover { color: var(--auth-orange); }

/* Provider badges */
.profile-provider {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem;
    border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--auth-border);
    font-size: 0.78rem; font-weight: 500; color: var(--auth-text-sec); margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.profile-provider svg { width: 16px; height: 16px; }

/* Danger zone */
.profile-danger {
    border-color: rgba(255,107,107,0.15);
    background: rgba(255,107,107,0.03);
}
.profile-danger h3 { color: var(--auth-error); }
.auth-btn--danger {
    background: rgba(255,107,107,0.12); color: var(--auth-error);
    border: 1px solid rgba(255,107,107,0.2);
}
.auth-btn--danger:hover {
    background: rgba(255,107,107,0.2); transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,107,107,0.15);
}

/* Session info */
.profile-meta { font-size: 0.75rem; color: var(--auth-text-muted); margin-top: 0.5rem; }

/* === Toast Notification === */
.auth-toast {
    position: fixed; top: 1.5rem; right: 1.5rem; z-index: 9999;
    padding: 0.85rem 1.25rem; border-radius: 12px;
    font-size: 0.82rem; font-weight: 500; display: none;
    align-items: center; gap: 0.5rem; max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: authToastIn 0.5s var(--auth-spring);
    backdrop-filter: blur(12px);
}
.auth-toast.show { display: flex; }
.auth-toast--success { background: rgba(92,225,230,0.15); border: 1px solid rgba(92,225,230,0.25); color: var(--auth-success); }
.auth-toast--error { background: rgba(255,107,107,0.15); border: 1px solid rgba(255,107,107,0.25); color: var(--auth-error); }
@keyframes authToastIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }

/* === Responsive === */
@media (max-width: 900px) {
    .auth-layout { flex-direction: column; }
    .auth-hero { min-height: 220px; padding: 2rem; }
    .auth-hero-title { font-size: 1.8rem; letter-spacing: 4px; }
    .auth-hero-tagline { display: none; }
    .auth-panel { width: 100%; min-width: unset; border-left: none; border-top: 1px solid var(--auth-border); padding: 2rem 1.5rem; }
}
@media (max-width: 480px) {
    .auth-panel { padding: 1.5rem 1rem; }
    .auth-card-header h2 { font-size: 1.4rem; }
    .auth-input { font-size: 16px; padding: 0.8rem 0.85rem; }
    .auth-btn { padding: 0.85rem; font-size: 0.9rem; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-field { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .profile-field-value { text-align: left; }
}
