/**
 * Rehan School — auth pages (login / signup)
 * Pairs with rs-theme.css variables when both loaded; otherwise self-contained.
 */
:root {
    --rs-auth-bg0: #070b14;
    --rs-auth-bg1: #12182a;
    --rs-auth-accent: #e94560;
    --rs-auth-violet: #7c5cff;
    --rs-auth-cyan: #22d3ee;
    --rs-auth-card: rgba(18, 24, 42, 0.82);
    --rs-auth-border: rgba(255, 255, 255, 0.1);
    --rs-auth-text: #f1f5ff;
    --rs-auth-muted: rgba(226, 232, 255, 0.72);
    --rs-font-body: "Plus Jakarta Sans", system-ui, sans-serif;
    --rs-font-display: "Syne", var(--rs-font-body);
    --rs-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.rs-login-page,
.rs-signup-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--rs-font-body);
    color: var(--rs-auth-text);
    background: radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.35), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(233, 69, 96, 0.28), transparent 50%),
        linear-gradient(165deg, var(--rs-auth-bg0), var(--rs-auth-bg1) 45%, #0a1020);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

.rs-auth-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.rs-auth-ambient .rs-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: rsOrbFloat 18s var(--rs-ease) infinite alternate;
}

.rs-auth-ambient .rs-orb:nth-child(1) {
    width: 320px;
    height: 320px;
    background: rgba(233, 69, 96, 0.5);
    top: -80px;
    right: -40px;
    animation-delay: -2s;
}

.rs-auth-ambient .rs-orb:nth-child(2) {
    width: 280px;
    height: 280px;
    background: rgba(124, 92, 255, 0.45);
    bottom: -60px;
    left: -80px;
    animation-delay: -6s;
}

.rs-auth-ambient .rs-orb:nth-child(3) {
    width: 200px;
    height: 200px;
    background: rgba(34, 211, 238, 0.25);
    top: 40%;
    left: 35%;
    animation-duration: 22s;
}

@keyframes rsOrbFloat {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-24px, 18px) scale(1.08); }
}

.rs-auth-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 75%);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.rs-auth-main {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.rs-auth-card {
    width: 100%;
    max-width: 440px;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border-radius: clamp(20px, 3vw, 28px);
    background: var(--rs-auth-card);
    border: 1px solid var(--rs-auth-border);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: rsAuthIn 0.7s var(--rs-ease) both;
}

@keyframes rsAuthIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.rs-auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.75rem;
}

.rs-auth-kicker i {
    color: var(--rs-auth-cyan);
    font-size: 0.65rem;
}

.rs-auth-card h1 {
    font-family: var(--rs-font-display);
    font-size: clamp(1.85rem, 4vw + 1rem, 2.65rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    background: linear-gradient(110deg, #fff 0%, #ffd0dc 40%, var(--rs-auth-accent) 75%, var(--rs-auth-violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.rs-auth-lead {
    font-size: clamp(0.9rem, 0.85rem + 0.35vw, 1.05rem);
    color: var(--rs-auth-muted);
    margin-bottom: 1.75rem;
    line-height: 1.55;
    font-weight: 500;
}

.rs-auth-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin: 0 auto 1.25rem;
    display: block;
    border-radius: 20px;
    border: 1px solid var(--rs-auth-border);
    background: rgba(255, 255, 255, 0.04);
    padding: 8px;
    box-shadow: 0 12px 40px rgba(233, 69, 96, 0.2);
}

.rs-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.rs-auth-alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.rs-field {
    margin-bottom: 1.15rem;
}

.rs-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.45rem;
}

.rs-field label i {
    color: var(--rs-auth-accent);
    margin-right: 0.35rem;
}

.rs-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.rs-input-wrap > i {
    position: absolute;
    left: 1rem;
    color: var(--rs-auth-accent);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.rs-input-wrap input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.65rem;
    border-radius: 14px;
    border: 1px solid var(--rs-auth-border);
    background: rgba(5, 8, 18, 0.55);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.25s var(--rs-ease), box-shadow 0.25s var(--rs-ease), transform 0.2s var(--rs-ease);
}

.rs-input-wrap:focus-within input {
    border-color: rgba(233, 69, 96, 0.55);
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.12);
}

.rs-input-wrap:focus-within > i {
    color: var(--rs-auth-cyan);
}

.rs-btn-primary {
    width: 100%;
    margin-top: 0.5rem;
    padding: 1rem 1.25rem;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(120deg, var(--rs-auth-accent), #ff7b9c 55%, var(--rs-auth-violet));
    background-size: 180% 100%;
    box-shadow: 0 14px 36px rgba(233, 69, 96, 0.35);
    transition: transform 0.2s var(--rs-ease), box-shadow 0.2s var(--rs-ease), background-position 0.45s var(--rs-ease);
}

.rs-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(233, 69, 96, 0.45);
    background-position: 100% 0;
}

.rs-btn-primary:active {
    transform: translateY(0);
}

.rs-auth-links {
    text-align: center;
    margin-top: 1.35rem;
    font-size: 0.9rem;
    color: var(--rs-auth-muted);
}

.rs-auth-links a {
    color: #fda4af;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.rs-auth-links a:hover {
    border-bottom-color: rgba(253, 164, 175, 0.6);
}

.rs-auth-note {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(226, 232, 255, 0.65);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rs-auth-border);
}

.rs-auth-note strong {
    color: #fda4af;
}

.rs-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.15rem;
    font-size: 0.85rem;
    color: rgba(200, 210, 235, 0.65);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s, transform 0.2s var(--rs-ease);
}

.rs-auth-back:hover {
    color: #fff;
    transform: translateX(-3px);
}

@media (prefers-reduced-motion: reduce) {
    .rs-auth-card,
    .rs-auth-ambient .rs-orb {
        animation: none !important;
    }
    .rs-btn-primary {
        transition: none;
    }
}

@media (max-width: 480px) {
    .rs-auth-card {
        padding: 1.5rem 1.25rem;
    }
}
