/* ============================
   RESET & VARIABLES
   ============================ */
:root {
    --gold: #DAA520;
    --gold-dark: #B8860B;
    --gold-glow: rgba(218, 165, 32, 0.5);
    --dark-bg: #050505;

    /* Fluid font sizing for all screens */
    --font-xs: clamp(0.7rem, 2vw, 0.8rem);
    --font-sm: clamp(0.8rem, 2.5vw, 0.9rem);
    --font-base: clamp(0.9rem, 3vw, 1rem);
    --font-lg: clamp(1rem, 3.5vw, 1.2rem);
    --font-xl: clamp(1.2rem, 4vw, 1.5rem);
    --font-2xl: clamp(1.4rem, 5vw, 2rem);

    /* Safe area insets for notched phones (iPhone X+) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

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

/* Prevent iOS text size adjust */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Centering Vertikal */
    background-color: var(--dark-bg);
    position: relative;
    color: #fff;
    padding: 20px;
    padding-top: calc(20px + var(--safe-top));
    padding-bottom: calc(20px + var(--safe-bottom));
    /* Jarak aman di layar kecil */
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* ============================
   BACKGROUND
   ============================ */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Pastikan path gambar background benar */
    background: url('../../assets/landing/2.png') no-repeat center center/cover;
    z-index: -2;
    transform: scale(1.05);
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.65) 100%);
    z-index: -1;
}

/* ============================
   GLASS CARD (Compact Style)
   ============================ */
.login-container {
    width: 100%;
    max-width: 400px;

    /* Padding pas, tidak kepanjangan */
    padding: 2rem 2rem;

    background: rgba(10, 8, 5, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(218, 165, 32, 0.3);
    border-top: 1px solid rgba(218, 165, 32, 0.6);
    border-bottom: 3px solid #DAA520;

    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    text-align: center;

    position: relative;
    z-index: 10;
}

/* ============================
   ELEMENTS
   ============================ */
.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 2px solid var(--gold);
    padding: 4px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 25px var(--gold-glow);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

h1 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.subtitle {
    color: #999;
    /* Improved from #888 for better contrast */
    font-size: 0.7rem;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

/* ============================
   FORMS
   ============================ */
.input-group {
    position: relative;
    margin-bottom: 1rem;
    text-align: left;
}

.input-group label {
    font-size: 0.65rem;
    color: var(--gold);
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 8px 15px;
    padding-left: 35px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #DAA520;
    /* Border jadi emas */
    background: rgba(0, 0, 0, 0.8);
    /* Background jadi lebih gelap pekat */
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.3);
    /* Glow emas di sekeliling */
    color: #fff;
}

/* Visual Feedback for Invalid Input */
.form-control:invalid:not(:placeholder-shown) {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.05);
}

.form-control:invalid:not(:placeholder-shown):focus {
    border-color: #ff6666;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
}

/* Visual Feedback for Valid Input */
.form-control:valid:not(:placeholder-shown) {
    border-color: #2ecc71;
}

.form-control:valid:not(:placeholder-shown):focus {
    border-color: #27ae60;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 12px;
    /* Account for label height */
    color: #555;
    transition: 0.3s;
    font-size: 0.8rem;
}

.form-control:focus+.input-icon {
    color: var(--gold);
}

/* Per-field validation error message */
.field-error {
    color: #ff6b6b;
    font-size: 0.75rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: slideDown 0.3s ease-out;
}

.field-error i {
    font-size: 0.7rem;
}

/* Field hint (format guidance) */
.field-hint {
    display: block;
    color: #666;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    font-style: italic;
    transition: color 0.3s;
}

.input-group:focus-within .field-hint {
    color: #999;
}

/* Dynamic invalid/valid states */
.form-control.is-invalid {
    border-color: #ff4444 !important;
    background: rgba(255, 68, 68, 0.05) !important;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3) !important;
}

.form-control.is-valid {
    border-color: #2ecc71 !important;
}

.form-control.is-valid:focus {
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2) !important;
}

/* Password requirements checklist */
.password-requirements {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.8rem;
}

.pw-req {
    font-size: 0.7rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.pw-req i {
    font-size: 0.4rem;
    transition: all 0.3s;
}

.pw-req.met {
    color: #2ecc71;
}

.pw-req.met i {
    color: #2ecc71;
}

/* ============================
   BUTTONS & LINKS
   ============================ */
.btn-login {
    width: 100%;
    padding: 10px;
    margin-top: 0.5rem;
    background: linear-gradient(to bottom, #cca43b, #8c6a18);
    color: #000;
    border: 1px solid #ffd700;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.btn-login:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 20px var(--gold-glow);
    transform: translateY(-2px);
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
}

.footer-links a {
    color: #aaa;
    /* Sedikit lebih terang dari sebelumnya */
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Saat mouse diarahkan, berubah jadi Emas */
.footer-links a:hover {
    color: #DAA520;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.5);
    /* Efek glow */
    transform: translateX(2px);
    /* Gerak dikit biar interaktif */
}

.back-link {
    display: flex;
    /* Biar icon panah dan teks sejajar rapi */
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #666;
    /* Warna default */
    text-decoration: none;
    transition: all 0.3s ease;

    /* Tambahkan border tipis transparan biar area klik luas */
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.back-link:hover {
    color: #fff;
    /* Teks jadi putih */
    border-color: rgba(255, 255, 255, 0.2);
    /* Muncul border tipis */
    background: rgba(255, 255, 255, 0.05);
    /* Background nyala dikit */
    transform: translateY(-2px);
    /* Naik dikit */
}

/* =========================================
   ALERT & STATUS MESSAGES (Global Component)
   ========================================= */

/* Gaya Dasar untuk semua tipe Alert */
.alert-error,
.alert-success,
.alert-warning {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    animation: slideDown 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shake animation for errors */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* 1. ALERT ERROR (Gagal Login / OTP Salah) */
.alert-error {
    /* Menggunakan warna yang mewah dan elegan (emas transparan) */
    background: rgba(184, 138, 27, 0.2);
    border: 1px solid #DAA520;
    color: #DAA520;
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.1);
    animation: slideDown 0.3s ease-out, shake 0.5s ease-in-out 0.3s;
}

/* 2. ALERT SUCCESS (Misalnya, Logout Berhasil) */
.alert-success {
    background: rgba(50, 205, 50, 0.2);
    border: 1px solid #32cd32;
    color: #98fb98;
}

/* 3. ALERT WARNING (Misalnya, Akun Menunggu Persetujuan) */
.alert-warning {
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid #ffa500;
    color: #ffa500;
}

/* --- TOAST/POPUP NOTIFICATION (Baru) --- */

.notification-container {
    position: fixed;
    top: 20px;
    /* Jarak awal dari atas */
    left: 50%;
    transform: translateX(-50%);
    /* Pusatkan secara horizontal */
    z-index: 1000;
    width: 90%;
    max-width: 450px;
    opacity: 0;
    /* Mulai tersembunyi */
    visibility: hidden;
    transition: all 0.4s ease-in-out;
}

.notification-container.show {
    opacity: 1;
    visibility: visible;
    top: 30px;
    /* Turunkan sedikit saat muncul */
}

.toast-alert {
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Gaya Warna Spesifik */
.toast-error {
    background-color: rgba(150, 0, 0, 0.9);
    /* Merah gelap */
    border: 1px solid #ff4444;
    color: #fff;
}

.toast-warning {
    /* Emas Gelap/Cokelat */
    background-color: rgba(184, 138, 27, 0.9);
    border: 1px solid var(--gold);
    color: var(--dark-bg);
    /* Teks hitam agar kontras */
}

.toast-success {
    background-color: rgba(0, 100, 0, 0.9);
    border: 1px solid #32cd32;
    color: #fff;
}

/* --- Tambahkan blok ini ke style.css global di bagian bawah --- */

.bg-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Path harus dari root ke folder assets */
    background: url('../../assets/landing/2.png') no-repeat center center/cover;
    z-index: -2;
    opacity: 0.4;
}

/* ============================
   RESPONSIVE BREAKPOINTS
   Covers all phone sizes:
   - Small phones: < 375px (iPhone SE)
   - Standard phones: 375-414px
   - Large phones: 414-430px (iPhone Plus/Max)
   - iPhone 15 Pro Max: 430px
   - Small tablets: 430-768px
   ============================ */

/* Extra small phones (iPhone SE, older models) */
@media screen and (max-width: 374px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 1.1rem;
    }

    .login-container {
        padding: 1.5rem 1.25rem;
    }

    .btn-login {
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* Standard phones (iPhone 12/13/14, most Android) */
@media screen and (max-width: 414px) {
    h1 {
        font-size: 1.2rem;
    }

    .form-control {
        height: 44px;
        /* iOS minimum touch target */
    }
}

/* Large phones (iPhone Plus, Pro Max, large Android) */
@media screen and (min-width: 415px) and (max-width: 480px) {
    .login-container {
        max-width: 420px;
    }

    h1 {
        font-size: 1.4rem;
    }
}

/* Small tablets and landscape phones */
@media screen and (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 30px;
    }

    .login-container {
        max-width: 450px;
        padding: 2.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets for mobile */
    .btn-login,
    .form-control,
    button,
    a {
        min-height: 44px;
    }

    /* Remove hover effects that don't work on touch */
    .btn-login:hover {
        transform: none;
    }
}

/* Landscape orientation on phones */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: calc(10px + var(--safe-top));
    }

    .login-container {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .login-logo {
        width: 50px;
        height: 50px;
    }
}