/* ================================================================
   auth.css — Authentication Pages Stylesheet
   Place: /lms-project/assets/css/auth.css
   Fonts: Sora (display) + DM Sans (body)
   Theme: Deep navy with electric blue accents, glassmorphism cards
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #0a0f1e;
    --navy-mid:   #0f1a35;
    --navy-card:  #111827;
    --blue:       #3b82f6;
    --blue-glow:  #60a5fa;
    --blue-dim:   #1d4ed8;
    --teal:       #06b6d4;
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --border:         rgba(255,255,255,0.08);
    --border-hover:   rgba(59,130,246,0.5);
    --input-bg:       rgba(255,255,255,0.05);
    --input-bg-focus: rgba(59,130,246,0.08);
    --success:    #22c55e;
    --error:      #ef4444;
    --card-bg:    rgba(17, 24, 39, 0.85);
    --radius:     14px;
    --radius-sm:  8px;
    --shadow:     0 25px 60px rgba(0,0,0,0.5);
}

html, body {
    height: 100%;
    background: var(--navy);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
}

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

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: drift 20s ease-in-out infinite alternate;
}

.orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #3b82f6, transparent);
    top: -200px; left: -150px;
    animation-duration: 18s;
}

.orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #06b6d4, transparent);
    bottom: -150px; right: -100px;
    animation-duration: 24s;
    animation-delay: -8s;
}

.orb-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #8b5cf6, transparent);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 30s;
    opacity: 0.08;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* ── Auth Wrapper ─────────────────────────────────────────────── */
.auth-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Brand Panel (left) ───────────────────────────────────────── */
.brand-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.brand-panel::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.brand-content {
    max-width: 440px;
    animation: fadeUp 0.8s ease both;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2.5rem;
}

.logo-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 12px rgba(59,130,246,0.8));
}

.logo-text {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-headline {
    font-family: 'Sora', sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
}

.highlight {
    background: linear-gradient(135deg, var(--blue), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Stats row */
.brand-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-num {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blue-glow);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Feature list (register page) */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feat-icon {
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* ── Form Panel (right) ───────────────────────────────────────── */
.form-panel {
    width: min(520px, 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.form-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: fadeUp 0.8s 0.1s ease both;
}

/* ── Form Header ──────────────────────────────────────────────── */
.form-header {
    margin-bottom: 1.75rem;
}

.form-header h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Alert Messages ───────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    animation: slideIn 0.3s ease;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.alert-error .alert-icon {
    background: rgba(239,68,68,0.3);
    color: #ef4444;
}

.alert-success .alert-icon {
    background: rgba(34,197,94,0.3);
    color: #22c55e;
}

.alert-link {
    color: #86efac;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.alert-link:hover { text-decoration: underline; }

/* ── Field Groups ─────────────────────────────────────────────── */
.field-group {
    margin-bottom: 1.1rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

/* ── Input Wrap ───────────────────────────────────────────────── */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 40px 11px 40px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
}

.input-wrap input::placeholder {
    color: var(--text-muted);
}

.input-wrap input:focus {
    border-color: var(--blue);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.input-icon {
    position: absolute;
    left: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrap:focus-within .input-icon {
    color: var(--blue-glow);
}

.toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.toggle-pw:hover { color: var(--blue-glow); }

/* ── Password Strength ────────────────────────────────────────── */
.pw-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -4px;
    margin-bottom: 10px;
}

.pw-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}

.pw-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.pw-label {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 48px;
    text-align: right;
}

/* ── Password Checklist ───────────────────────────────────────── */
.pw-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 1.25rem;
}

.pw-checklist li {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-left: 18px;
    position: relative;
    transition: color 0.2s;
}

.pw-checklist li::before {
    content: '○';
    position: absolute;
    left: 0;
    transition: content 0.2s, color 0.2s;
}

.pw-checklist li.ok {
    color: var(--success);
}

.pw-checklist li.ok::before {
    content: '✓';
    color: var(--success);
}

/* ── Primary Button ───────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dim));
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 20px rgba(59,130,246,0.35);
    letter-spacing: 0.01em;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(59,130,246,0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-arrow {
    transition: transform 0.2s;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(3px);
}

/* Loading state */
.btn-primary.loading .btn-text::after {
    content: '...';
}

/* ── Form Footer ──────────────────────────────────────────────── */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--blue-glow);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.2s;
}

.form-footer a:hover { color: #fff; }

/* ── Demo Hint ────────────────────────────────────────────────── */
.demo-hint {
    text-align: center;
    margin-top: 1rem;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.demo-label {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 3px;
    font-weight: 600;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    html, body { overflow: auto; }

    .auth-wrapper { flex-direction: column; height: auto; min-height: 100vh; }

    .brand-panel {
        padding: 2rem 1.5rem 1.5rem;
        flex: none;
    }

    .brand-panel::after { display: none; }

    .brand-headline { font-size: 2rem; }

    .brand-stats { gap: 1.2rem; }

    .form-panel {
        width: 100%;
        padding: 1rem 1.25rem 2rem;
        align-items: flex-start;
    }

    .form-card { padding: 1.75rem 1.5rem; }

    .field-row { grid-template-columns: 1fr; }
}
