/* ==========================================================================
   🔐 NEXTEDU NEXUS — SECURE ACCOUNT RECOVERY CSS
   Ecosystem: forgot-password.html (Public) & reset-password.html (Telegram)
   Design Tokens: Obsidian Dark & Frosted Light / 60FPS Hardware-Composited
   ========================================================================== */

:root {
    --nexus-bg: #060913;
    --nexus-bg-alt: #0a0f1d;
    --nexus-surface: #0d1527;
    --nexus-surface-hover: #131f38;
    --nexus-card-bg: rgba(13, 21, 39, 0.88);
    --nexus-card-border: rgba(56, 189, 248, 0.16);
    --nexus-glass-border: rgba(255, 255, 255, 0.08);
    --nexus-input-bg: rgba(10, 15, 29, 0.75);
    --nexus-input-border: rgba(56, 189, 248, 0.2);
    
    --nexus-text: #f8fafc;
    --nexus-text-muted: #94a3b8;
    --nexus-text-dim: #64748b;
    
    /* Semantic Accents */
    --nexus-cyan: #38bdf8;
    --nexus-cyan-glow: rgba(56, 189, 248, 0.28);
    --nexus-blue: #2563eb;
    --nexus-blue-glow: rgba(37, 99, 235, 0.25);
    --nexus-violet: #8b5cf6;
    --nexus-violet-glow: rgba(139, 92, 246, 0.25);
    --nexus-emerald: #10b981;
    --nexus-emerald-glow: rgba(16, 185, 129, 0.25);
    --nexus-rose: #ef4444;
    --nexus-rose-glow: rgba(239, 68, 68, 0.25);
    --nexus-gold: #fbbf24;
    --nexus-gold-glow: rgba(251, 191, 36, 0.25);
    --nexus-telegram: #229ED9;
    --nexus-telegram-glow: rgba(34, 158, 217, 0.28);

    /* Typography */
    --font-heading: 'Orbitron', -apple-system, sans-serif;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sub: 'Outfit', sans-serif;
    --font-mono: 'Space Grotesk', 'Courier New', monospace;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-card: 0 20px 50px -10px rgba(0, 0, 0, 0.75);
    --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
}

[data-theme="light"] {
    --nexus-bg: #f1f5f9;
    --nexus-bg-alt: #e2e8f0;
    --nexus-surface: #ffffff;
    --nexus-surface-hover: #f8fafc;
    --nexus-card-bg: rgba(255, 255, 255, 0.94);
    --nexus-card-border: rgba(148, 163, 184, 0.28);
    --nexus-glass-border: rgba(148, 163, 184, 0.2);
    --nexus-input-bg: #f8fafc;
    --nexus-input-border: rgba(148, 163, 184, 0.35);
    
    --nexus-text: #0f172a;
    --nexus-text-muted: #475569;
    --nexus-text-dim: #94a3b8;
    
    --nexus-cyan: #0284c7;
    --nexus-cyan-glow: rgba(2, 132, 199, 0.18);
    --shadow-card: 0 15px 35px -5px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.1);
}

/* Base resets & layout */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--nexus-bg) !important;
    color: var(--nexus-text);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Subtle Animated Background */
.animated-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(circle at 20% 25%, rgba(56, 189, 248, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(139, 92, 246, 0.05) 0%, transparent 45%);
}

/* Drift Glow Background Ambient Orbs */
.orb-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: recoveryOrbDrift 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, transparent 70%);
    top: -5%;
    right: 15%;
}

.orb-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.14) 0%, transparent 70%);
    bottom: 5%;
    left: 10%;
    animation-delay: -8s;
}

.orb-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(34, 158, 217, 0.12) 0%, transparent 70%);
    top: 40%;
    left: 45%;
    animation-delay: -14s;
}

@keyframes recoveryOrbDrift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(25px, -20px) scale(1.05); }
    100% { transform: translate(-20px, 25px) scale(0.95); }
}

/* Top Navigation Bar */
.recovery-top-bar {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 1.5px;
    color: var(--nexus-text);
    transition: var(--transition-fast);
}

.brand-badge i {
    color: var(--nexus-cyan);
    font-size: 1.25rem;
    filter: drop-shadow(0 0 8px var(--nexus-cyan-glow));
}

.brand-badge span {
    background: linear-gradient(135deg, var(--nexus-cyan), var(--nexus-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-card-border);
    color: var(--nexus-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-fast);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.theme-toggle-btn:hover {
    border-color: var(--nexus-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--nexus-cyan-glow);
}

/* Main Recovery Wrapper */
.recovery-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 460px;
    padding: 90px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Glass Recovery Card */
.recovery-card {
    width: 100%;
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.recovery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--nexus-cyan), var(--nexus-violet), transparent);
    opacity: 0.9;
}

/* Telegram Portal Variation */
.recovery-card.telegram-portal::before {
    background: linear-gradient(90deg, transparent, var(--nexus-telegram), #0088cc, transparent);
}

/* Card Header Section */
.card-header {
    text-align: center;
    margin-bottom: 24px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--nexus-cyan);
    margin-bottom: 14px;
}

.security-badge i {
    font-size: 0.8rem;
}

.security-badge.telegram-badge {
    background: rgba(34, 158, 217, 0.1);
    border-color: rgba(34, 158, 217, 0.25);
    color: var(--nexus-telegram);
}

.card-title {
    margin: 0 0 8px 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--nexus-text);
    font-family: var(--font-body);
}

.card-subtitle {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--nexus-text-muted);
}

/* Recovery Step Tracker */
.recovery-step-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--nexus-glass-border);
}

.tracker-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--nexus-text-dim);
    transition: var(--transition-fast);
}

.tracker-step.active {
    color: var(--nexus-cyan);
}

.tracker-step.completed {
    color: var(--nexus-emerald);
}

.tracker-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--nexus-input-bg);
    border: 1.5px solid var(--nexus-input-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.tracker-step.active .tracker-dot {
    background: var(--nexus-cyan);
    border-color: var(--nexus-cyan);
    color: #060913;
    box-shadow: 0 0 12px var(--nexus-cyan-glow);
}

.tracker-step.completed .tracker-dot {
    background: var(--nexus-emerald);
    border-color: var(--nexus-emerald);
    color: #ffffff;
    box-shadow: 0 0 10px var(--nexus-emerald-glow);
}

.tracker-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tracker-line {
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: var(--nexus-glass-border);
    margin: 0 12px;
    transition: var(--transition-fast);
}

.tracker-line.active {
    background: linear-gradient(90deg, var(--nexus-cyan), var(--nexus-emerald));
}

/* Contact Details Preview Pill */
.context-preview-pill {
    background: rgba(56, 189, 248, 0.07);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.context-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--nexus-text);
}

.context-info i {
    color: var(--nexus-cyan);
    font-size: 1rem;
}

.context-edit-btn {
    background: none;
    border: none;
    color: var(--nexus-cyan);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.context-edit-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    text-decoration: underline;
}

/* Form Steps */
.form-step {
    display: none;
    animation: recoveryFadeIn 0.3s ease forwards;
}

.form-step.active {
    display: block;
}

@keyframes recoveryFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--nexus-text);
    margin-bottom: 8px;
    text-align: left;
}

.input-field-wrap {
    position: relative;
    width: 100%;
}

.input-field-wrap input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--nexus-input-bg);
    border: 1px solid var(--nexus-input-border);
    border-radius: var(--radius-md);
    color: var(--nexus-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.input-field-wrap input:focus {
    border-color: var(--nexus-cyan);
    box-shadow: 0 0 0 3px var(--nexus-cyan-glow);
    background: var(--nexus-surface);
}

.input-field-wrap input::placeholder {
    color: var(--nexus-text-dim);
}

.input-field-wrap > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nexus-text-dim);
    font-size: 1rem;
    transition: var(--transition-fast);
    pointer-events: none;
}

.input-field-wrap input:focus + i,
.input-field-wrap input:focus ~ i {
    color: var(--nexus-cyan);
}

/* Password Toggle Field */
.pass-group input {
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--nexus-text-dim);
    cursor: pointer;
    padding: 6px;
    font-size: 1rem;
    border-radius: 6px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--nexus-cyan);
}

/* OTP Console Input */
.otp-input {
    font-family: var(--font-mono) !important;
    font-size: 1.3rem !important;
    letter-spacing: 6px !important;
    text-align: center !important;
    font-weight: 700 !important;
    padding-left: 44px !important;
}

.otp-hint {
    font-size: 0.78rem;
    color: var(--nexus-text-muted);
    margin-top: 6px;
    text-align: left;
}

.password-hint {
    font-size: 0.78rem;
    color: var(--nexus-text-dim);
    margin-top: 6px;
    text-align: left;
}

/* Action Buttons */
.btn-main {
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--nexus-blue) 0%, var(--nexus-cyan) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 24px var(--nexus-cyan-glow);
    margin-top: 8px;
}

.btn-main:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.4);
    filter: brightness(1.05);
}

.btn-main:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Telegram Portal Button */
.btn-telegram {
    background: linear-gradient(135deg, #0088cc 0%, var(--nexus-telegram) 100%);
    box-shadow: 0 8px 24px var(--nexus-telegram-glow);
}

.btn-telegram:hover:not(:disabled) {
    box-shadow: 0 12px 28px rgba(34, 158, 217, 0.4);
}

/* Secondary Button */
.btn-secondary {
    width: 100%;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--nexus-card-border);
    border-radius: var(--radius-md);
    color: var(--nexus-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--nexus-cyan);
}

/* Message & Alert Banners */
.message-box {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.88rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
}

.message-box.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--nexus-rose);
}

.message-box.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--nexus-emerald);
}

.message-box.info {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--nexus-cyan);
}

/* Bottom Navigation Link */
.bottom-nav {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--nexus-glass-border);
    text-align: center;
    font-size: 0.88rem;
    color: var(--nexus-text-muted);
}

.bottom-nav a {
    color: var(--nexus-cyan);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.bottom-nav a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Success Confirmation Screen */
.recovery-success-screen {
    text-align: center;
    padding: 20px 10px;
    animation: recoveryScaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes recoveryScaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.success-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.14);
    border: 2px solid var(--nexus-emerald);
    color: var(--nexus-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px var(--nexus-emerald-glow);
}

.success-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--nexus-text);
    margin: 0 0 10px;
}

.success-desc {
    font-size: 0.92rem;
    color: var(--nexus-text-muted);
    line-height: 1.5;
    margin: 0 0 24px;
}

/* Access Denied Context Screen */
.recovery-denied-screen {
    text-align: center;
    padding: 20px 10px;
}

.denied-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    border: 2px solid var(--nexus-rose);
    color: var(--nexus-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    box-shadow: 0 0 25px var(--nexus-rose-glow);
}

/* Toast Notifications */
.toast-notification {
    visibility: hidden;
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(-25px) scale(0.95);
    background: rgba(13, 21, 39, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--nexus-card-border);
    border-radius: var(--radius-md);
    padding: 14px 22px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    max-width: 90%;
}

.toast-notification.show {
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

.toast-notification.success {
    border-left: 4px solid var(--nexus-emerald);
}

.toast-notification.success i {
    color: var(--nexus-emerald);
}

.toast-notification.error {
    border-left: 4px solid var(--nexus-rose);
}

.toast-notification.error i {
    color: var(--nexus-rose);
}

/* Mobile Responsiveness */
@media (max-width: 520px) {
    .recovery-top-bar {
        padding: 0 18px;
        top: 18px;
    }
    
    .recovery-wrapper {
        padding: 80px 14px 30px;
        max-width: 100%;
    }
    
    .recovery-card {
        padding: 28px 20px;
        border-radius: var(--radius-md);
    }
    
    .card-title {
        font-size: 1.35rem;
    }
    
    .otp-input {
        font-size: 1.15rem !important;
        letter-spacing: 4px !important;
    }
}

@media (max-width: 360px) {
    .card-title {
        font-size: 1.25rem;
    }
    
    .recovery-card {
        padding: 22px 16px;
    }
    
    .btn-main {
        padding: 13px 18px;
        font-size: 0.92rem;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .bg-orb {
        animation: none !important;
    }
}
