@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@4.2.0/fonts/remixicon.css');

:root {
    --gold: #c9a84c;
    --gold-light: #f0c040;
    --gold-glow: rgba(201, 168, 76, 0.4);
    --bg-dark: #0a0a0f;
    --bg-dark2: #0f0f1a;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(201, 168, 76, 0.2);
    --glass-blur: blur(20px);
    --shadow-dark: rgba(0, 0, 0, 0.6);
    --shadow-light: rgba(255, 255, 255, 0.03);
    --text-primary: #f0e6c8;
    --text-muted: rgba(240, 230, 200, 0.5);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(201, 168, 76, 0.25);
}

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

html,
body {
    background-color: var(--bg-dark);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(201, 168, 76, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(100, 60, 180, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(10, 10, 20, 1) 0%, rgba(5, 5, 15, 1) 100%);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(201, 168, 76, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 10%, rgba(201, 168, 76, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 70%, rgba(201, 168, 76, 0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 10% 80%, rgba(201, 168, 76, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 50%, rgba(201, 168, 76, 0.1) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

/* ===== LOGO CONTAINER ===== */
.logo-container {
    margin-bottom: 1.5rem;
}

.logo-container img {
    filter: drop-shadow(0 0 20px var(--gold-glow));
    max-width: 200px;
}

/* ===== GLASS CARD ===== */
.bg-glass {
    background: rgba(10, 10, 15, 0.84);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px !important;
    margin: auto;
    box-shadow:
        0 8px 32px var(--shadow-dark),
        0 1px 0 var(--shadow-light) inset,
        0 0 60px rgba(201, 168, 76, 0.05);
    position: relative;
    overflow: hidden;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .bg-glass {
        background: var(--glass-bg);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
    }
}

.bg-glass::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
}

/* ===== HEADER ===== */
.header-container {
    margin-bottom: 2rem;
    text-align: center;
}

.header-text {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), #a07830);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    text-shadow: none;
    filter: drop-shadow(0 0 12px var(--gold-glow));
}

/* ===== FORM CONTAINER ===== */
.form-container {
    gap: 0;
    margin-bottom: 1.5rem;
}

/* ===== INPUT GROUP ===== */
.input-group-custom {
    margin-bottom: 1rem;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        4px 4px 10px rgba(0, 0, 0, 0.5),
        -2px -2px 6px rgba(255, 255, 255, 0.03);
    border: 1px solid var(--input-border);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group-custom:focus-within {
    border-color: var(--gold);
    box-shadow:
        4px 4px 10px rgba(0, 0, 0, 0.5),
        -2px -2px 6px rgba(255, 255, 255, 0.03),
        0 0 0 2px rgba(201, 168, 76, 0.15),
        0 0 20px rgba(201, 168, 76, 0.1);
}

.input-group-custom.second,
.input-group-custom.spaced {
    margin-bottom: 1rem;
}

.input-icon {
    background: rgba(201, 168, 76, 0.08) !important;
    border: none !important;
    border-right: 1px solid var(--input-border) !important;
    padding: 0.75rem 0.9rem;
    color: var(--gold) !important;
    font-size: 1.1rem;
}

.input-icon img {
    filter: brightness(0) saturate(100%) invert(75%) sepia(40%) saturate(500%) hue-rotate(5deg) brightness(95%);
    opacity: 0.85;
}

.input-icon i {
    color: var(--gold);
    font-size: 1.1rem;
}

.input-field {
    background: var(--input-bg) !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    outline: none !important;
    box-shadow: none !important;
}

.input-field::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.07) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

/* ===== BUTTON CONTAINER ===== */
.button-container {
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* ===== LOGIN / REGISTER BUTTON ===== */
.login-button {
    background: linear-gradient(135deg, #c9a84c, #f0c040, #a07830) !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 0.85rem 1.5rem !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.5px;
    color: #0a0a0f !important;
    box-shadow:
        0 4px 20px rgba(201, 168, 76, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px rgba(201, 168, 76, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    background: linear-gradient(135deg, #d4b55a, #f5cc50, #b08840) !important;
}

.login-button:active {
    transform: translateY(0);
    box-shadow:
        0 2px 10px rgba(201, 168, 76, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== REGISTER TEXT ===== */
.register-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.5rem;
}

.register-text a {
    color: var(--gold-light) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s, text-shadow 0.2s;
}

.register-text a:hover {
    color: #fff !important;
    text-shadow: 0 0 10px var(--gold-glow);
}

/* ===== CAPTCHA ===== */
.captcha-container {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    background: rgba(201, 168, 76, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    transition: background 0.2s;
}

.captcha-container:hover {
    background: rgba(201, 168, 76, 0.2);
}

#captchaText {
    color: var(--gold-light) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: 4px;
    text-shadow: 0 0 8px var(--gold-glow);
}

#captchaText span {
    display: inline-block;
    transform: rotate(calc(-10deg + (20deg * var(--r, 0))));
    margin: 0 1px;
}

/* ===== ALERT ===== */
.alert-danger {
    background: rgba(220, 53, 69, 0.15) !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
    color: #ff6b7a !important;
    border-radius: 12px !important;
    backdrop-filter: blur(10px);
    margin-bottom: 1rem;
}

/* ===== SWEETALERT2 CUSTOM ===== */
.swal2-glass-modal {
    background: rgba(15, 15, 26, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    color: var(--text-primary) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(201, 168, 76, 0.1) !important;
}

.swal2-glass-modal .swal2-title {
    color: var(--gold-light) !important;
}

.swal2-glass-modal .swal2-html-container {
    color: var(--text-muted) !important;
}

.swal2-glass-modal .swal2-confirm {
    background: linear-gradient(135deg, #c9a84c, #f0c040) !important;
    color: #0a0a0f !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4) !important;
}

.swal2-mobile-captcha {
    background: rgba(15, 15, 26, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    color: var(--text-primary) !important;
}

.swal2-mobile-captcha .swal2-title {
    color: var(--gold-light) !important;
}

.swal2-mobile-captcha .swal2-confirm {
    background: linear-gradient(135deg, #c9a84c, #f0c040) !important;
    color: #0a0a0f !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .bg-glass {
        padding: 2rem 1.25rem;
        border-radius: 20px;
        max-width: 95% !important;
    }

    .header-text {
        font-size: 1.35rem;
    }

    .logo-container img {
        max-width: 160px;
    }
}

/* Mobile GPU-safe mode: prevent white flicker on some Android compositors */
@media (hover: none) and (pointer: coarse) {
    body::before {
        display: none;
    }

    .bg-glass,
    .alert-danger,
    .swal2-glass-modal,
    .swal2-mobile-captcha {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .bg-glass,
    .swal2-glass-modal,
    .swal2-mobile-captcha {
        background: rgba(10, 10, 15, 0.92) !important;
    }
}
