﻿/* ============================================================
   auth-styles.css  —  Darul Quran Madrasha
   Two-Panel Professional Design · Neumorphic + Gradient
   ============================================================ */

:root {
    --bg: #dde1e7;
    --sh-dark: #babecc;
    --sh-light: #ffffff73;
    --primary: #0E4194;
    --primary-dk: #092d6b;
    --primary-xdk: #061d46;
    --gold: #b8960c;
    --gold-light: #e8c547;
    --text-dark: #595959;
    --text-mid: #777;
    --danger: #c0392b;
    --success: #22c55e;
    --neu-out: 5px 5px 10px var(--sh-dark), -5px -5px 10px var(--sh-light);
    --neu-in: inset 2px 2px 5px var(--sh-dark), inset -5px -5px 10px var(--sh-light);
    --neu-focus: inset 1px 1px 2px var(--sh-dark), inset -1px -1px 2px var(--sh-light);
    --r: 16px;
    --tr: all 0.25s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background: var(--bg);
    overflow: hidden;
    font-family: 'Crimson Pro', serif;
    -webkit-font-smoothing: antialiased;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

/* ── Particles ──────────────────────────────────────────── */
#particles-js {
    position: fixed;
    inset: 0;
    z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   TWO-PANEL WRAPPER
══════════════════════════════════════════════════════════ */
.auth-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ── Brand Panel (Left) ─────────────────────────────────── */
.brand-panel {
    width: 36%;
    max-width: 380px;
    height: min(680px, 94vh);
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dk) 55%, var(--primary-xdk) 100%);
    border-radius: 28px 0 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
    box-shadow: -6px 0 40px rgba(9,45,107,0.25);
    flex-shrink: 0;
}

/* Geometric ring decorations */
.geo-ring {
    position: absolute;
    border: 1.5px solid rgba(184,150,12,0.18);
    border-radius: 50%;
    pointer-events: none;
}

/* Brand Logo */
.brand-logo-wrap {
    width: clamp(110px, 16vh, 160px);
    height: clamp(110px, 16vh, 160px);
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    animation: logoFloat 5s ease-in-out infinite;
    margin-bottom: 22px;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15), 0 0 0 7px rgba(184,150,12,0.18), 0 0 0 12px rgba(184,150,12,0.08);
}

    .brand-logo-wrap::before {
        content: '';
        position: absolute;
        inset: -8px;
        border-radius: 50%;
        background: conic-gradient( from 0deg, transparent 0%, rgba(184,150,12,0) 10%, rgba(184,150,12,.5) 30%, rgba(232,197,71,.8) 50%, rgba(184,150,12,.5) 70%, rgba(184,150,12,0) 90%, transparent 100% );
        animation: haloSpin 6s linear infinite;
        z-index: -1;
    }

    .brand-logo-wrap .tenor-gif-embed,
    .brand-logo-wrap iframe {
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        display: block;
        border-radius: 50%;
        overflow: hidden;
        background: transparent !important;
    }

/* Brand Text */
.brand-title {
    font-family: 'Amiri', serif;
    font-size: clamp(16px, 2.2vh, 22px);
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.35;
    margin-bottom: 8px;
}

.brand-arabic {
    font-family: 'Amiri', serif;
    font-size: clamp(13px, 1.8vh, 18px);
    color: var(--gold-light);
    text-align: center;
    direction: rtl;
    margin-bottom: 18px;
    opacity: 0.9;
}

.brand-divider {
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 2px;
    margin-bottom: 16px;
}

.brand-tagline {
    font-family: 'Amiri', serif;
    font-size: clamp(9px, 1.3vh, 13px);
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.22em;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(184,150,12,.4);
    min-height: 1.4em;
}

/* Decorative dots grid */
.brand-dots {
    position: absolute;
    bottom: 32px;
    right: 24px;
    display: grid;
    grid-template-columns: repeat(4, 8px);
    gap: 7px;
}

.bdot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(184,150,12,0.3);
}

/* ── Form Panel (Right) ─────────────────────────────────── */
.form-panel {
    flex: 1;
    max-width: 520px;
    height: min(680px, 94vh);
    background: var(--bg);
    border-radius: 0 28px 28px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    box-shadow: 6px 0 40px rgba(9,45,107,0.12), 0 8px 32px rgba(9,45,107,0.1);
}

.form-panel-header {
    width: 88%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 28px;
    flex-shrink: 0;
}

/* Login page — vertically centered (no scroll needed) */
.form-panel--center {
    justify-content: center;
}

.form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--gold), var(--primary-dk));
    border-radius: 0 28px 0 0;
}

/* Secure badge */
.secure-badge {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(14,65,148,0.07);
    border: 1px solid rgba(14,65,148,0.15);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.03em;
    z-index: 5;
}

.secure-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(34,197,94,.2);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(34,197,94,.35);
    }
}

/* ── Form Card ──────────────────────────────────────────── */
.form-card {
    width: 88%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-card--scroll {
    flex: 1;
    width: 88%;
    max-width: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--sh-dark) transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
}

    .form-card--scroll .form-heading,
    .form-card--scroll .form-sub,
    .form-card--scroll form,
    .form-card--scroll .card-footer {
        width: 100%;
    }

    .form-card--scroll::-webkit-scrollbar {
        width: 4px;
    }

    .form-card--scroll::-webkit-scrollbar-thumb {
        background: var(--sh-dark);
        border-radius: 4px;
    }

/* School logo */
.card-logo {
    width: clamp(52px, 8vh, 72px);
    margin-bottom: 16px;
    border-radius: 50%;
    box-shadow: var(--neu-out);
    transition: var(--tr);
    cursor: pointer;
}

    .card-logo:hover {
        box-shadow: var(--neu-in);
        transform: scale(0.97);
    }

/* ── Tab Switcher ───────────────────────────────────────── */
.tab-switcher {
    display: flex;
    gap: 6px;
    background: var(--bg);
    border-radius: 22px;
    padding: 5px;
    box-shadow: var(--neu-in);
    margin-bottom: 22px;
    width: 100%;
}

.tab-btn {
    flex: 1;
    height: 38px;
    border: none;
    border-radius: 18px;
    font-family: 'Crimson Pro', serif;
    font-size: clamp(12px, 1.6vh, 14.5px);
    font-weight: 600;
    cursor: pointer;
    transition: var(--tr);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-mid);
    background: transparent;
}

    .tab-btn.active {
        background: linear-gradient(135deg, var(--primary), var(--primary-dk));
        color: #fff;
        box-shadow: 0 4px 14px rgba(14,65,148,0.32);
    }

    .tab-btn:not(.active):hover {
        color: var(--primary);
    }

/* ── Headings ───────────────────────────────────────────── */
.form-heading {
    font-family: 'Amiri', serif;
    font-size: clamp(22px, 3.5vh, 30px);
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    line-height: 1.1;
    margin-bottom: 4px;
    width: 100%;
}

.form-sub {
    font-size: clamp(12px, 1.55vh, 14px);
    color: var(--text-mid);
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

/* ── Fields Area ────────────────────────────────────────── */
.fields-area {
    width: 100%;
    margin-bottom: 4px;
}

.field-wrap {
    margin-bottom: 14px;
    width: 100%;
}

.field-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 6px;
    margin-left: 2px;
    opacity: 0.85;
}

    .field-label i {
        margin-right: 5px;
        font-size: 10px;
    }

.field-row {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 14px;
    box-shadow: var(--neu-in);
    height: clamp(42px, 6.2vh, 50px);
    padding: 0 12px;
    transition: var(--tr);
    position: relative;
}

    .field-row:focus-within {
        box-shadow: var(--neu-focus), 0 0 0 2px rgba(14,65,148,0.15);
    }

.field-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-dark);
    font-size: clamp(13.5px, 1.95vh, 16px);
    font-family: 'Crimson Pro', serif;
}

    .field-input::placeholder {
        color: #aaa;
        font-size: clamp(12px, 1.7vh, 14.5px);
        font-style: italic;
    }

/* Eye button */
.eye-btn {
    background: none;
    border: none;
    color: var(--text-mid);
    font-size: clamp(13px, 1.8vh, 15px);
    cursor: pointer;
    padding: 4px 2px;
    transition: var(--tr);
    flex-shrink: 0;
}

    .eye-btn:hover {
        color: var(--primary);
    }

/* Field error */
.field-error {
    display: block;
    color: var(--danger);
    font-size: 11.5px;
    margin: 4px 0 0 4px;
    min-height: 1em;
}

    .field-error:empty {
        display: none;
    }

/* Server alert */
.auth-server-alert {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: .6rem .9rem;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 12.5px;
    text-align: left;
    width: 100%;
}

    .auth-server-alert:empty {
        display: none;
    }

/* ── Password Strength ──────────────────────────────────── */
.strength-wrap {
    height: 4px;
    background: var(--sh-dark);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width .4s ease, background .4s ease;
}

/* ── Extras Row (Remember + Forgot) ─────────────────────── */
.extras-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 18px;
}

/* Remember Me toggle */
.remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    display: none;
}

.toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    transition: background .3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.2);
    flex-shrink: 0;
}

.toggle-checkbox:checked + .toggle-track {
    background: var(--gold);
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 9px;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    transition: left .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-checkbox:checked ~ * .toggle-thumb,
.toggle-checkbox:checked + .toggle-track .toggle-thumb {
    left: 23px;
}

.toggle-circles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.tcircle {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, #f5f5f5, #ccc);
}

.remember-txt {
    font-size: 13px;
    color: var(--text-mid);
}

/* Forgot password link */
.forgot-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Crimson Pro', serif;
    cursor: pointer;
    padding: 0;
    transition: var(--tr);
    display: flex;
    align-items: center;
    gap: 4px;
}

    .forgot-link:hover {
        color: var(--gold);
    }

/* ── Primary Button ─────────────────────────────────────── */
.btn-primary {
    width: 100%;
    height: clamp(44px, 6.2vh, 52px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Crimson Pro', serif;
    font-size: clamp(14px, 2vh, 17px);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(14,65,148,0.35), 0 2px 6px rgba(14,65,148,0.2);
    transition: var(--tr);
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

    .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -60%;
        width: 40%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transform: skewX(-20deg);
        animation: shimmer 3s ease infinite;
    }

@keyframes shimmer {
    0% {
        left: -60%;
    }

    100% {
        left: 130%;
    }
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(14,65,148,0.42), 0 4px 10px rgba(14,65,148,0.24);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(14,65,148,0.28);
}

.btn-arrow {
    margin-left: auto;
    opacity: 0.7;
    font-size: 12px;
}

/* Ghost / secondary button */
.btn-ghost {
    flex: 0 0 auto;
    height: clamp(44px, 6.2vh, 52px);
    padding: 0 20px;
    background: var(--bg);
    color: var(--text-dark);
    border: none;
    border-radius: 14px;
    font-family: 'Crimson Pro', serif;
    font-size: clamp(13px, 1.8vh, 15px);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--neu-out);
    transition: var(--tr);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .btn-ghost:hover {
        transform: translateY(-1px);
        box-shadow: 6px 6px 14px var(--sh-dark), -6px -6px 14px var(--sh-light);
        color: var(--primary);
    }

    .btn-ghost:active {
        box-shadow: var(--neu-in);
        transform: none;
    }

.btn-row-two {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

    .btn-row-two .btn-primary {
        flex: 1;
        margin-bottom: 0;
    }

/* ── Forgot heading ─────────────────────────────────────── */
.forgot-heading {
    font-size: clamp(15px, 2.2vh, 18px);
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 18px;
    width: 100%;
}

/* ── Terms row (Register) ───────────────────────────────── */
.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 6px;
}

.terms-check-wrap {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.terms-checkbox {
    opacity: 0;
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 1;
}

.terms-checkmark {
    position: absolute;
    inset: 0;
    background: var(--bg);
    border-radius: 7px;
    box-shadow: var(--neu-in);
    transition: var(--tr);
}

.terms-checkbox:checked ~ .terms-checkmark {
    background: var(--primary);
    box-shadow: 0 3px 10px rgba(14,65,148,0.3);
}

.terms-checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--gold-light);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.terms-checkbox:checked ~ .terms-checkmark::after {
    display: block;
}

.terms-text {
    font-size: 12.5px;
    color: var(--text-mid);
    line-height: 1.6;
}

.terms-link {
    color: var(--primary);
    text-decoration: underline;
    pointer-events: auto;
    transition: color .2s;
}

    .terms-link:hover {
        color: var(--gold);
    }

/* ── Card Footer ─────────────────────────────────────────── */
.card-footer {
    font-size: 11.5px;
    color: var(--text-mid);
    margin-top: 12px;
    text-align: center;
    padding-bottom: 4px;
    opacity: 0.75;
}

    .card-footer span {
        font-weight: 700;
        color: var(--primary);
    }

/* ── Page Footer ─────────────────────────────────────────── */
.page-footer {
    background: rgba(46,190,255,0.5);
    border-radius: 16px;
    box-shadow: 1px 0 30px #2196f3db;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.44);
    padding: 5px 16px;
    position: fixed;
    bottom: 1%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-dark);
    z-index: 10;
}

/* ── Floating Shapes ────────────────────────────────────── */
.Canimation {
    pointer-events: none;
}

/* ── Keyframes ──────────────────────────────────────────── */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }

    25% {
        transform: translateY(-6px) scale(1.016);
    }

    75% {
        transform: translateY(4px) scale(0.987);
    }
}

@keyframes haloSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media screen and (max-width: 900px) {
    .auth-wrapper {
        padding: 0;
        align-items: stretch;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

        .form-panel::before {
            border-radius: 0;
        }

    .form-card {
        width: 92%;
        max-width: 420px;
    }

    .secure-badge {
        top: 12px;
        right: 14px;
    }
}

@media screen and (max-width: 480px) {
    .form-card {
        width: 96%;
    }

    .form-heading {
        font-size: 24px;
    }

    .btn-primary {
        font-size: 15px;
    }

    .tab-btn {
        font-size: 13px;
    }
}
