/* ==========================================================================
   PORTAL AUTENTIKASI (MASUK, DAFTAR, LUPA SANDI)
   Sekolah Islam Al-Qur'an Imam Syafi'i
   Refined Architectural Card + Emerald & Gold Parallax Background
   ========================================================================== */

:root {
    --primary-dark: #071f12;
    --primary-color: #114b2a;
    --primary-mid: #19673b;
    --primary-soft: #eef5f0;
    --secondary-color: #c59b27;
    --secondary-light: #e7c96a;
    --danger-color: #dc2626;
    --text-dark: #112218;
    --text-muted: #53665b;
    --border-color: #d4e0d8;
    --surface: #ffffff;
    --surface-subtle: #f7faf8;
    --font-main: 'Poppins', sans-serif;
    --font-arabic: 'Amiri', serif;
    --transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at 20% 20%, #145a32 0%, #0b2e1b 52%, #061a0e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    position: relative;
    overflow-x: hidden;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   BACKGROUND & ORNAMEN PARALLAX (DIPERTAHANKAN SESUAI KONSEP UTAMA)
   ========================================================================== */
.auth-bg-layer {
    position: fixed;
    inset: -8%;
    background-size: cover;
    background-position: center;
    opacity: 0.16;
    filter: saturate(1.1) contrast(1.05);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.auth-pattern-overlay {
    position: fixed;
    inset: -10%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='0.9' stroke-opacity='0.18'%3E%3Cpolygon points='60,8 73,42 108,42 80,63 90,98 60,77 30,98 40,63 12,42 47,42'/%3E%3Ccircle cx='60' cy='60' r='34'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px 120px;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.auth-glow-orb {
    position: fixed;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.22) 0%, rgba(20, 90, 50, 0.12) 50%, transparent 72%);
    filter: blur(28px);
    top: 8%;
    right: 8%;
    pointer-events: none;
    z-index: 0;
}

/* ==========================================================================
   ARCHITECTURAL PORTAL CARD (TANPA GAMBAR DI DALAM CARD, BERSIH & FORMAL)
   ========================================================================== */
.auth-card-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--surface);
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.38);
    box-shadow:
        0 24px 60px rgba(3, 14, 8, 0.55),
        0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    overflow: hidden;
    transition: max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Lebarkan sedikit secara halus hanya saat tab Daftar aktif agar 2 kolom tetap lega */
.auth-card-container.is-register {
    max-width: 560px;
}

/* Garis Aksen Kubah / Mihrab Tipis di Puncak Card */
.auth-card-top-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-color) 25%, var(--secondary-color) 50%, var(--primary-color) 75%, var(--primary-dark) 100%);
}

/* Frame Garis Dalam Halus (Editorial Border) */
.auth-card-inner {
    padding: 34px 36px 28px;
    position: relative;
}

/* ======== HEADER IDENTITAS SEKOLAH DI ATAS FORM ======== */
.auth-identity-header {
    text-align: center;
    padding-bottom: 22px;
    border-bottom: 1px solid #e6ede8;
    margin-bottom: 22px;
    position: relative;
}

/* Ornamen Diamond Kecil di Tengah Garis Pembatas */
.auth-identity-header::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 0 0 0 4px var(--surface);
}

.auth-seal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 14px;
    background: var(--surface-subtle);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(17, 75, 42, 0.07);
    margin-bottom: 12px;
    padding: 7px;
    transition: var(--transition);
}

.auth-seal-link:hover {
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.auth-seal-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-basmalah {
    font-family: var(--font-arabic);
    font-size: 1.35rem;
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 4px;
}

.auth-school-name {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.auth-portal-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary-color);
    margin-top: 3px;
}

/* ======== NAVIGASI TAB EDITORIAL (GARIS BAWAH TEGAS, BUKAN PILL GENERIK) ======== */
.tab-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1.5px solid #e3ebe6;
    margin-bottom: 22px;
    gap: 4px;
}

.tab-btn {
    padding: 10px 12px 12px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ======== FORM WRAPPERS ======== */
.form-wrapper {
    display: none;
}

.form-wrapper.active {
    display: block;
    animation: fadeIn 0.24s ease;
}

.form-section-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

/* Grid 2 Kolom untuk Form Registrasi */
.input-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ======== FIELD INPUT DENGAN LABEL EKSPLISIT ======== */
.field-group {
    margin-bottom: 15px;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.01em;
}

.input-group {
    position: relative;
}

.input-group > i:not(.toggle-password) {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7f73;
    font-size: 0.88rem;
    z-index: 2;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 11px 14px 11px 38px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-subtle);
    font-family: var(--font-main);
    font-size: 0.86rem;
    color: var(--text-dark);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.input-group input::placeholder {
    color: #94a59b;
}

.input-group input[type="password"],
.input-group input.has-toggle {
    padding-right: 38px !important;
}

.input-group input:hover {
    border-color: #b7c9be;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(17, 75, 42, 0.1);
}

.input-group:focus-within > i:not(.toggle-password) {
    color: var(--primary-color);
}

/* Toggle Password Icon */
.toggle-password {
    position: absolute !important;
    right: 12px !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
    cursor: pointer;
    color: #7c8f84;
    transition: color 0.2s ease;
    pointer-events: auto !important;
    z-index: 5;
    font-size: 0.88rem;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Link Lupa Sandi */
.forgot-pass {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.76rem;
    text-decoration: none;
    transition: var(--transition);
}

.forgot-pass:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Catatan Ketentuan Password */
.password-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    background: var(--surface-subtle);
    border: 1px solid #dfe8e2;
    border-left: 3px solid var(--secondary-color);
    padding: 8px 11px;
    border-radius: 7px;
    margin-bottom: 16px;
    line-height: 1.45;
}

.password-hint i {
    color: var(--secondary-color);
    margin-right: 4px;
}

/* ======== TOMBOL UTAMA (TEGAS & BERSIH) ======== */
.btn-submit {
    width: 100%;
    padding: 12px 18px;
    background-color: var(--primary-color);
    color: var(--surface);
    border-radius: 9px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.88rem;
    border: 1px solid var(--primary-dark);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-submit:hover {
    background-color: var(--primary-dark);
    border-color: var(--secondary-color);
}

.btn-submit:active {
    transform: translateY(1px);
}

/* ======== FOOTER BAR DI DALAM CARD ======== */
.auth-card-footer {
    background: var(--surface-subtle);
    border-top: 1px solid #e6ede8;
    padding: 14px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.back-home:hover {
    color: var(--primary-color);
}

.footer-help-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
}

.footer-help-link:hover {
    text-decoration: underline;
}

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

/* ======== RESPONSIVE MOBILE ======== */
@media (max-width: 600px) {
    body {
        padding: 18px 12px;
    }

    .auth-card-container,
    .auth-card-container.is-register {
        max-width: 100%;
        border-radius: 14px;
    }

    .auth-card-inner {
        padding: 26px 20px 22px;
    }

    .auth-card-footer {
        padding: 13px 20px;
    }

    .input-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
