/* ============================================================
   Delitebook Auth Pages — visual design adapted from
   the SeenLoop /application/login.php page (purple/pink blob,
   orbit satellites, glass card). All animations preserved.
   ============================================================ */

:root {
    --bg: #0b0716;
    --bg-2: #120a24;
    --surface: #ffffff;
    --surface-2: #f7f6fb;
    --card: #ffffff;
    --text: #1a1030;
    --text-mut: #6b6485;
    --border: #ece9f4;
    --primary: #7c3aed;
    --primary-2: #6d28d9;
    --accent: #ec4899;
    --accent-2: #f472b6;
    --info: #22d3ee;
    --success: #22c55e;
    --danger: #ef4444;
    --warn: #f59e0b;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 6px rgba(20, 10, 50, 0.06);
    --shadow-md: 0 10px 30px rgba(20, 10, 50, 0.08);
    --shadow-lg: 0 25px 60px rgba(124, 58, 237, 0.15);
    --grad: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --grad-2: linear-gradient(135deg, #22d3ee 0%, #7c3aed 100%);
    --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
    --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-head: 'Poppins', 'Inter', sans-serif;
    --transition: 0.28s cubic-bezier(.4, 0, .2, 1);
}

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

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--surface-2);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(124, 58, 237, 0.45); text-decoration: none; }
.btn-primary:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ============ BRAND ============ */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: inline-flex; }
.brand-accent {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    z-index: 400;
    opacity: 0;
    transition: all 0.4s cubic-bezier(.34, 1.56, .64, 1);
    box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

/* ============ ANIMATIONS ============ */
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(30px, -40px) scale(1.08); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70%  { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes shakeX {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-6px); }
    75%     { transform: translateX(6px); }
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulseIn {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.06); }
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ==================== LOGIN / REGISTER PAGE ==================== */
.login-body {
    min-height: 100vh;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
}

/* ========== TOP BAR ========== */
.login-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-actions .mut { color: var(--text-mut); font-size: 14px; }

/* ========== MAIN LAYOUT ========== */
.login-wrap {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 74px);
    position: relative;
    background: linear-gradient(135deg, #f5f2ff 0%, #fdf2f8 100%);
    overflow: hidden;
}

/* ============ LEFT BRAND SIDE ============ */
.login-brand-side {
    position: relative;
    z-index: 1;
    background: transparent;
    display: flex;
    align-items: center;
    padding: 40px 60px;
}

/* Full-page floating blob background */
.lb-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.lb-bg .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 14s ease-in-out infinite;
}
.lb-bg .blob.b1 { width: 480px; height: 480px; background: #a78bfa; top: -140px; left: -100px; }
.lb-bg .blob.b2 { width: 540px; height: 540px; background: #f9a8d4; bottom: -180px; right: -150px; animation-delay: -5s; }
.lb-bg .blob.b3 { width: 380px; height: 380px; background: #67e8f9; top: 45%; left: 30%; animation-delay: -9s; opacity: 0.35; }
.lb-bg .grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.lb-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 780px;
    animation: fadeUp 0.7s ease;
    display: flex;
    flex-direction: column;
    gap: 44px;
}

/* ===== Top header ===== */
.lb-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 18px;
}
.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: pulse 1.8s infinite;
}
.lb-title {
    font-family: var(--font-head);
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin: 0 0 14px;
    color: var(--text);
    white-space: nowrap;
}
.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lb-sub {
    font-size: 15.5px;
    color: var(--text-mut);
    margin: 0 0 28px;
    line-height: 1.6;
    max-width: 560px;
}

/* Stats row */
.lb-stats { display: flex; flex-direction: row; align-items: center; gap: 24px; flex-wrap: wrap; }
.lb-stats > div:not(.lb-stats-divider) { display: flex; flex-direction: column; }
.lb-stats strong {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}
.lb-stats span {
    font-size: 11.5px;
    color: var(--text-mut);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 5px;
    font-weight: 600;
}
.lb-stats-divider { width: 1px; height: 34px; background: var(--border); align-self: center; }

/* Bottom: orbit + mission */
.lb-bottom { display: grid; grid-template-columns: 220px 1fr; gap: 60px; align-items: center; }

/* Orbit */
.lb-orbit { position: relative; width: 220px; height: 220px; margin: 0; display: flex; align-items: center; justify-content: center; }
.lb-orbit-core {
    position: absolute; top: 50%; left: 50%;
    width: 58px; height: 58px; border-radius: 16px;
    background: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
    transform: translate(-50%, -50%); z-index: 2;
    animation: coreBob 4s ease-in-out infinite;
}
@keyframes coreBob {
    0%,100% { transform: translate(-50%, -50%) scale(1); }
    50%     { transform: translate(-50%, -55%) scale(1.04); }
}
.lb-ring {
    position: absolute; top: 50%; left: 50%;
    border-radius: 50%; border: 2px dashed rgba(124, 58, 237, 0.35);
    transform: translate(-50%, -50%);
}
.lb-ring-1 { width: 140px; height: 140px; animation: abSpin 22s linear infinite; }
.lb-ring-2 { width: 200px; height: 200px; border-color: rgba(236, 72, 153, 0.32); animation: abSpin 40s linear infinite reverse; }
@keyframes abSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.lb-sat {
    position: absolute; top: 50%; left: 50%;
    width: 38px; height: 38px; background: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; box-shadow: 0 6px 14px rgba(124, 58, 237, 0.28); z-index: 3;
}
.lb-sat.s1 { animation: satOrbLb 16s linear infinite; }
.lb-sat.s2 { animation: satOrbLb 16s linear infinite -4s; }
.lb-sat.s3 { animation: satOrbLb 20s linear infinite -8s reverse; }
.lb-sat.s4 { animation: satOrbLb 20s linear infinite -14s reverse; }
@keyframes satOrbLb {
    from { transform: translate(-50%, -50%) rotate(0deg)   translateY(-80px) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg) translateY(-80px) rotate(-360deg); }
}

/* Mission (no box) */
.lb-mission { padding: 0; background: transparent; border: 0; box-shadow: none; }
.lb-mission h3 {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-head);
    font-size: 13px; color: var(--primary);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    font-weight: 800;
}
.lb-mission-dot {
    display: inline-block; width: 8px; height: 8px;
    background: var(--grad); border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}
.lb-mission p { margin: 0; font-size: 14.5px; color: var(--text); line-height: 1.75; max-width: 520px; }
.lb-mission p strong { color: var(--primary); font-weight: 700; }

/* ============ RIGHT FORM SIDE ============ */
.login-form-side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 40px 30px;
    background: transparent;
    animation: fadeUp 0.7s ease 0.1s both;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    padding: 36px 34px 30px;
    box-shadow:
        0 30px 60px -20px rgba(124, 58, 237, 0.22),
        0 12px 30px -12px rgba(236, 72, 153, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

.login-head { margin-bottom: 24px; text-align: center; }
.login-head h2 {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -1px;
}
.login-head p { margin: 0; color: var(--text-mut); font-size: 14px; }

/* Auth banner (success / error / info notes above form) */
.auth-banner {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 14px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    margin: 0 0 14px;
    border: 1px solid transparent;
}
.auth-banner-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.auth-banner-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.auth-banner-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.auth-banner .link   { color: inherit; text-decoration: underline; margin-right: 8px; }
.auth-banner-close   { margin-left: auto; background: transparent; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }
.auth-banner-close:hover { opacity: 1; }

/* Fields */
.login-card .field { margin-bottom: 14px; }
.login-card label {
    display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.link-sm { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 500; }
.link-sm:hover { text-decoration: underline; }

.input-with-ic { position: relative; }
.input-ic {
    position: absolute; top: 50%; left: 12px; transform: translateY(-50%);
    font-size: 15px; pointer-events: none; z-index: 2;
}
.input-with-ic input,
.input-with-ic select {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    transition: all var(--transition);
    outline: none;
    appearance: none;
}
.pw-wrap input { padding-right: 42px; }
.pw-wrap .pw-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; cursor: pointer;
    font-size: 16px; padding: 6px; z-index: 2;
}
.input-with-ic input:focus,
.input-with-ic select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}
.field.invalid input,
.field.invalid select {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    animation: shakeX 0.3s ease;
}
.field .err {
    display: none;
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}
.field.invalid .err { display: block; }

.options-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; }
.check-inline {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text);
    cursor: pointer; user-select: none;
}
.check-inline input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Buttons inside card */
.btn-full { width: 100%; justify-content: center; }
.btn.loading .btn-label { opacity: 0.6; }
.btn .spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
    border-radius: 50%; animation: sp 0.8s linear infinite; margin-left: 6px;
}

/* Divider + social */
.or-divider {
    text-align: center; margin: 24px 0 16px;
    position: relative; color: var(--text-mut);
    font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
}
.or-divider::before, .or-divider::after {
    content: ''; position: absolute; top: 50%;
    width: calc(50% - 80px); height: 1px; background: var(--border);
}
.or-divider::before { left: 0; }
.or-divider::after  { right: 0; }
.social-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.social-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px; background: #fff; border: 1.5px solid var(--border);
    border-radius: 10px; font-family: var(--font-body);
    font-size: 13px; font-weight: 600; color: var(--text);
    cursor: pointer; transition: all var(--transition);
}
.social-btn:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.signup-cta { text-align: center; font-size: 14px; color: var(--text-mut); margin: 0; }
.signup-cta a { color: var(--primary); font-weight: 600; text-decoration: none; }
.signup-cta a:hover { text-decoration: underline; }

.tiny-legal { margin: 20px 0 0; font-size: 12px; color: var(--text-mut); text-align: center; position: relative; z-index: 1; }
.tiny-legal a { color: var(--text-mut); text-decoration: underline; }

/* Hidden helper (matches existing Edu auth.css) */
.auth-hidden { display: none !important; }

/* Success overlay */
.login-success {
    position: fixed; inset: 0; background: rgba(11, 7, 22, 0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 500; opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.login-success.show { opacity: 1; visibility: visible; }
.login-success .ls-card {
    background: #fff; border-radius: 20px;
    padding: 40px 32px; text-align: center; max-width: 380px;
    animation: popIn 0.4s cubic-bezier(.34, 1.56, .64, 1);
}
.ls-icon {
    width: 72px; height: 72px; margin: 0 auto 16px;
    background: var(--grad); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: #fff;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.4);
    animation: pulseIn 1.4s ease infinite;
}
.ls-card h3 { font-family: var(--font-head); font-size: 22px; margin: 0 0 6px; color: var(--text); }
.ls-card p  { color: var(--text-mut); font-size: 14px; margin: 0 0 16px; }

/* Forgot-password modal (reuse of the existing modal shell) */
.auth-modal {
    position: fixed; inset: 0; background: rgba(11, 7, 22, 0.55);
    display: none; align-items: center; justify-content: center;
    z-index: 600; padding: 20px;
}
.auth-modal.open { display: flex; }
.auth-modal-card {
    background: #fff; border-radius: 20px; padding: 28px 26px;
    max-width: 420px; width: 100%;
    box-shadow: 0 30px 60px -20px rgba(124, 58, 237, .35);
    animation: popIn 0.35s cubic-bezier(.34, 1.56, .64, 1);
}
.auth-modal-card h3 { font-family: var(--font-head); font-size: 20px; margin: 0 0 6px; }
.auth-modal-card .sub { color: var(--text-mut); font-size: 13.5px; margin: 0 0 16px; }
.modal-input {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 14px; font-family: var(--font-body);
    margin-bottom: 14px; outline: none; transition: all var(--transition);
}
.modal-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-btn { padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 13.5px; border: 0; cursor: pointer; }
.modal-btn.ghost { background: transparent; color: var(--text-mut); }
.modal-btn.primary { background: var(--grad); color: #fff; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .lb-inner { max-width: 680px; }
    .lb-bottom { gap: 44px; }
}
@media (max-width: 1240px) {
    .lb-title { white-space: normal; font-size: clamp(22px, 2.4vw, 28px); }
    .lb-inner { max-width: 580px; }
    .lb-bottom { grid-template-columns: 190px 1fr; gap: 30px; }
    .lb-orbit { width: 190px; height: 190px; }
    .lb-ring-1 { width: 120px; height: 120px; }
    .lb-ring-2 { width: 180px; height: 180px; }
    .lb-stats strong { font-size: 26px; }
    .lb-stats { gap: 18px; }
    .lb-stats-divider { height: 30px; }
    @keyframes satOrbLb {
        from { transform: translate(-50%, -50%) rotate(0deg)   translateY(-68px) rotate(0deg); }
        to   { transform: translate(-50%, -50%) rotate(360deg) translateY(-68px) rotate(-360deg); }
    }
}
@media (max-width: 900px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-brand-side { display: none; }
    .login-form-side { padding: 20px; }
    .login-topbar { padding: 16px 20px; }
    .lb-orbit { display: none; }
    .login-card {
        background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
        border: 0; border-radius: 0; padding: 8px 0 0; box-shadow: none;
    }
}
@media (max-width: 480px) {
    .login-topbar .mut { display: none; }
    .login-head h2 { font-size: 26px; }
    .social-row { grid-template-columns: 1fr; }
}

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
