/* WS School - Auth Pages - Split Panel with Card Shadow */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --auth-primary: #1e3a5f;
    --auth-primary-dark: #0f2440;
    --auth-primary-light: #2d5a8e;
    --auth-accent: #c9a227;
    --auth-success: #10b981;
    --auth-danger: #ef4444;
    --auth-bg: #f5f7fa;
    --auth-surface: #ffffff;
    --auth-text: #1a1a2e;
    --auth-text-muted: #6b7280;
    --auth-border: #e5e7eb;
    --auth-radius: 20px;
    --auth-radius-sm: 12px;
    --auth-input-bg: #eef1f8;
    --auth-gradient-start: #b8336a;
    --auth-gradient-end: #7c3aed;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--auth-bg);
    min-height: 100vh;
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
}

/* ===== SPLIT LAYOUT ===== */
.auth-page {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ===== LEFT PANEL - Branding ===== */
.auth-visual {
    flex: 0 0 45%;
    background: linear-gradient(160deg, var(--auth-primary-dark) 0%, var(--auth-primary) 45%, var(--auth-primary-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* Subtle background pattern */
.auth-visual::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 500px 500px at 30% 40%, rgba(201,162,39,.08) 0%, transparent 60%),
        radial-gradient(ellipse 300px 300px at 70% 70%, rgba(255,255,255,.04) 0%, transparent 50%);
    pointer-events: none;
}

/* Floating shapes */
.auth-shapes {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1;
}
.auth-shapes span {
    position: absolute;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 50%;
    animation: floatShape linear infinite;
}
@keyframes floatShape {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

.visual-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: #fff;
    max-width: 360px;
}

.visual-logo {
    width: 80px; height: 80px;
    border-radius: 20px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    font-size: 1.8rem;
    color: var(--auth-accent);
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    transition: transform .3s ease;
}
.visual-logo:hover { transform: scale(1.05); }
.visual-logo img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }

.visual-content .welcome-text {
    font-size: .95rem;
    font-weight: 400;
    color: rgba(255,255,255,.7);
    margin-bottom: 8px;
}

.visual-content .school-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.visual-content > p {
    color: rgba(255,255,255,.5);
    font-size: .88rem;
    line-height: 1.7;
    max-width: 300px;
    margin: 0 auto;
}

/* ===== RIGHT PANEL - Form Card ===== */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    background: var(--auth-bg);
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    padding: 40px 36px;
    box-shadow: 0 8px 40px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
    border: 1px solid rgba(0,0,0,.05);
    animation: fadeUp .4s ease;
}

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

/* Back link */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 28px;
    transition: color .2s;
}
.auth-back:hover { color: var(--auth-primary); }

/* Mobile logo (hidden on desktop) */
.auth-mobile-logo { display: none; }
.auth-mobile-brand { display: none; }

/* Header */
.auth-header { margin-bottom: 24px; }

.auth-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--auth-text);
    letter-spacing: -.02em;
}

.auth-header p {
    color: var(--auth-text-muted);
    font-size: .88rem;
    margin-top: 6px;
    line-height: 1.5;
}

/* Messages */
.auth-msg {
    padding: 12px 16px;
    border-radius: var(--auth-radius-sm);
    font-size: .84rem;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: slideDown .25s ease;
}
.auth-msg.show { display: flex; }
.auth-msg.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.auth-msg.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.auth-msg i { font-size: 1rem; flex-shrink: 0; }

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

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field label {
    display: block;
    font-weight: 600;
    font-size: .82rem;
    color: var(--auth-text);
    margin-bottom: 6px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .input-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: .9rem;
    pointer-events: none;
    transition: color .2s;
}

.auth-input-wrap input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid transparent;
    border-radius: var(--auth-radius-sm);
    font-size: .92rem;
    font-family: var(--font-body);
    color: var(--auth-text);
    background: var(--auth-input-bg);
    transition: all .2s;
    outline: none;
}

.auth-input-wrap input::placeholder { color: #9ca3af; font-size: .88rem; }

.auth-input-wrap input:focus {
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30,58,95,.06);
}

.auth-input-wrap input:focus + .input-icon,
.auth-input-wrap input:focus ~ .input-icon { color: var(--auth-primary); }

/* Password toggle */
.pw-toggle {
    position: absolute;
    right: 16px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: .95rem;
    padding: 4px;
    transition: color .2s;
}
.pw-toggle:hover { color: var(--auth-text); }

/* Password strength */
.pw-strength {
    height: 4px;
    border-radius: 2px;
    background: var(--auth-border);
    margin-top: 8px;
    overflow: hidden;
}
.pw-strength .pw-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all .35s ease;
}
.pw-hint {
    font-size: .76rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Row (remember/forgot) */
.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--auth-text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-row label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--auth-primary);
    border-radius: 4px;
}

.auth-row a {
    color: var(--auth-gradient-start);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}
.auth-row a:hover { opacity: .75; text-decoration: underline; }

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--auth-radius-sm);
    font-size: .92rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .25s ease;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    color: #fff;
    box-shadow: 0 4px 16px rgba(184,51,106,.25);
}
.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(184,51,106,.3);
}
.auth-btn-primary:active { transform: translateY(0); }
.auth-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.auth-btn-google {
    background: #fff;
    color: #374151;
    border: 1.5px solid var(--auth-border);
    font-weight: 500;
}
.auth-btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.auth-btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
.google-signin-slot {
    display: flex;
    justify-content: center;
    min-height: 44px;
    margin: 0 0 8px;
}
.google-signin-slot[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0;
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 500;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: .85rem;
    color: var(--auth-text-muted);
}
.auth-footer a {
    color: var(--auth-gradient-start);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

/* Terms */
.auth-terms {
    font-size: .74rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 4px;
    line-height: 1.5;
}
.auth-terms a { color: var(--auth-gradient-start); text-decoration: none; }

/* ===== SHARED COMPONENTS ===== */

/* Verify Email Icon */
.verify-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2rem;
    transition: all .5s ease;
}
.verify-icon.loading {
    background: rgba(184,51,106,.1);
    color: var(--auth-gradient-start);
    animation: verifyPulse 1.5s ease infinite;
}
.verify-icon.success {
    background: rgba(16,185,129,.1);
    color: #10b981;
}
.verify-icon.error {
    background: rgba(239,68,68,.1);
    color: #ef4444;
}
@keyframes verifyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.verify-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 8px;
}
.verify-desc {
    text-align: center;
    color: var(--auth-text-muted);
    font-size: .92rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ===== RESPONSIVE ===== */

/* Tablet - card on gradient */
@media (max-width: 960px) {
    .auth-visual { display: none; }
    .auth-form-panel {
        flex: 1;
        padding: 32px 24px;
        min-height: 100vh;
        background: linear-gradient(160deg, var(--auth-primary-dark) 0%, var(--auth-primary) 45%, var(--auth-primary-light) 100%);
    }
    .auth-form-container {
        max-width: 440px;
        margin: 0 auto;
    }
    .auth-mobile-logo {
        display: flex;
        width: 56px; height: 56px;
        border-radius: 16px;
        background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-light));
        color: #fff;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        margin: 0;
        box-shadow: 0 4px 16px rgba(30,58,95,.25);
    }
    .auth-mobile-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
        color: var(--auth-text);
    }
    .auth-mobile-logo img {
        display: block;
        width: 100%;
        height: 100%;
        padding: 6px;
        border-radius: inherit;
        object-fit: contain;
        background: #fff;
    }
    .auth-mobile-brand-text {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    .auth-mobile-school-name {
        font-size: .92rem;
        font-weight: 700;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
    .auth-mobile-motto {
        color: var(--auth-text-muted);
        font-size: .75rem;
        line-height: 1.35;
    }
    .auth-back { color: var(--auth-text-muted); }
    .auth-back:hover { color: var(--auth-primary); }
}

/* Mobile - compact */
@media (max-width: 480px) {
    .auth-form-panel { padding: 16px; padding-top: 40px; }
    .auth-form-container { padding: 28px 22px; border-radius: 16px; }
    .auth-header h1 { font-size: 1.25rem; }
    .auth-field label { font-size: .8rem; }
    .auth-input-wrap input { padding: 12px 14px 12px 42px; font-size: .88rem; }
    .auth-btn { padding: 13px; font-size: .88rem; }
    .auth-row { flex-direction: column; gap: 12px; align-items: flex-start; }
}
