/* ===========================
   CSS Variables & Reset
=========================== */

:root {
    /* Brand Colors */
    --brand-yellow: #f2ee66;
    --brand-yellow-light: #f5f28a;
    --brand-yellow-dark: #d4cc3d;
    --brand-green: #0b4b06;
    --brand-green-light: #0d6308;
    --brand-green-dark: #072e04;

    /* Accent Colors */
    --accent-lime: #9acd32;
    --accent-gold: #e6c74c;

    /* Dark Theme */
    --dark-bg: #0f1410;
    --dark-card: #1a2218;
    --dark-card-hover: #233024;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a8b5a3;

    /* Status Colors */
    --error-red: #ff4757;
    --success-green: #2ed573;

    /* Effects */
    --shadow: rgba(0, 0, 0, 0.4);
    --yellow-glow: rgba(242, 238, 102, 0.15);
    --green-glow: rgba(11, 75, 6, 0.25);
}

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

/* ===========================
   Base Styles
=========================== */

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--brand-green-dark) 0%, var(--dark-bg) 30%, var(--brand-green-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(242, 238, 102, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(11, 75, 6, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: subtleFloat 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(11, 75, 6, 0.02) 2px,
            rgba(11, 75, 6, 0.02) 4px
    );
    pointer-events: none;
    z-index: 0;
}

/* ===========================
   Language Switcher
=========================== */

.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.lang-btn {
    padding: 10px 18px;
    background: var(--dark-card);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(11, 75, 6, 0.3);
    position: relative;
    overflow: hidden;
}

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

.lang-btn:hover::before {
    left: 100%;
}

.lang-btn:hover {
    background: var(--dark-card-hover);
    color: var(--brand-yellow);
    border-color: var(--brand-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 238, 102, 0.2), 0 2px 8px rgba(11, 75, 6, 0.3);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--brand-yellow) 0%, var(--accent-gold) 100%);
    color: var(--brand-green-dark);
    font-weight: 600;
    border-color: var(--brand-yellow);
    box-shadow: 0 4px 15px rgba(242, 238, 102, 0.4), 0 0 20px rgba(242, 238, 102, 0.2);
}

/* ===========================
   Container & Card
=========================== */

.container {
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease;
    position: relative;
    z-index: 1;
}

.login-card {
    background: linear-gradient(135deg, var(--dark-card) 0%, rgba(11, 75, 6, 0.15) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 45px 40px;
    box-shadow:
            0 10px 40px var(--shadow),
            0 0 0 1px rgba(242, 238, 102, 0.2),
            inset 0 1px 0 rgba(242, 238, 102, 0.1);
    border: 2px solid rgba(11, 75, 6, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
            135deg,
            var(--brand-yellow) 0%,
            var(--brand-green) 25%,
            var(--accent-lime) 50%,
            var(--brand-green) 75%,
            var(--brand-yellow) 100%
    );
    border-radius: 24px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

.login-card:hover::before {
    opacity: 0.2;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow:
            0 15px 50px rgba(11, 75, 6, 0.4),
            0 0 60px rgba(242, 238, 102, 0.15),
            inset 0 1px 0 rgba(242, 238, 102, 0.2);
    border-color: rgba(242, 238, 102, 0.4);
}

/* ===========================
   Icon & Typography
=========================== */

.lock-icon {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.lock-icon svg {
    color: var(--brand-yellow);
    filter:
            drop-shadow(0 0 15px rgba(242, 238, 102, 0.5))
            drop-shadow(0 0 30px rgba(242, 238, 102, 0.3))
            drop-shadow(0 0 45px rgba(11, 75, 6, 0.2));
    animation: pulse 3s ease-in-out infinite;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
    background: linear-gradient(
            135deg,
            var(--brand-yellow) 0%,
            var(--brand-yellow-light) 50%,
            var(--accent-lime) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(242, 238, 102, 0.3);
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 30px;
}

/* ===========================
   Error Messages
=========================== */

.error-message {
    background: rgba(255, 71, 87, 0.12);
    border-left: 4px solid var(--error-red);
    color: var(--error-red);
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease, fadeIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.error-message.locked {
    background: rgba(242, 238, 102, 0.15);
    border-left-color: var(--brand-yellow);
    color: var(--brand-yellow);
}

.error-message svg {
    flex-shrink: 0;
}

/* ===========================
   Form Styles
=========================== */

.login-form {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.password-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(7, 46, 4, 0.4);
    border: 2px solid rgba(11, 75, 6, 0.5);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    backdrop-filter: blur(10px);
}

.password-input:focus {
    border-color: var(--brand-yellow);
    background: rgba(7, 46, 4, 0.6);
    box-shadow:
            0 0 0 4px rgba(242, 238, 102, 0.15),
            0 4px 12px rgba(242, 238, 102, 0.2),
            inset 0 1px 3px rgba(11, 75, 6, 0.3);
}

.password-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.password-input::placeholder {
    color: var(--text-secondary);
}

/* ===========================
   Attempts Info
=========================== */

.attempts-info {
    background: linear-gradient(
            135deg,
            rgba(242, 238, 102, 0.15) 0%,
            rgba(11, 75, 6, 0.2) 100%
    );
    border: 1px solid var(--brand-yellow);
    color: var(--brand-yellow);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
    box-shadow:
            0 2px 8px rgba(242, 238, 102, 0.15),
            inset 0 1px 0 rgba(242, 238, 102, 0.1);
    backdrop-filter: blur(10px);
}

.attempts-info strong {
    font-weight: 700;
    color: var(--brand-yellow-light);
}

/* ===========================
   Submit Button
=========================== */

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--brand-yellow) 0%, var(--accent-gold) 100%);
    color: var(--brand-green-dark);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
            0 4px 15px rgba(242, 238, 102, 0.4),
            0 2px 8px rgba(11, 75, 6, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--brand-yellow-dark);
}

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

.submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--brand-yellow-light) 0%, var(--brand-yellow) 100%);
    transform: translateY(-3px);
    box-shadow:
            0 8px 25px rgba(242, 238, 102, 0.5),
            0 4px 15px rgba(11, 75, 6, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
            0 4px 15px rgba(242, 238, 102, 0.4),
            0 2px 8px rgba(11, 75, 6, 0.3);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===========================
   Footer
=========================== */

.footer {
    position: absolute;
    bottom: 20px;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 300;
    opacity: 0.8;
}

/* ===========================
   Animations
=========================== */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter:
                drop-shadow(0 0 15px rgba(242, 238, 102, 0.5))
                drop-shadow(0 0 30px rgba(242, 238, 102, 0.3))
                drop-shadow(0 0 45px rgba(11, 75, 6, 0.2));
    }
    50% {
        transform: scale(1.05);
        filter:
                drop-shadow(0 0 20px rgba(242, 238, 102, 0.7))
                drop-shadow(0 0 40px rgba(242, 238, 102, 0.4))
                drop-shadow(0 0 60px rgba(11, 75, 6, 0.3));
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ===========================
   Responsive Design
=========================== */

@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }

    .login-card {
        padding: 35px 30px;
    }

    h1 {
        font-size: 24px;
    }

    .language-switcher {
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 25px;
        border-radius: 20px;
    }

    h1 {
        font-size: 22px;
    }

    .lock-icon svg {
        width: 48px;
        height: 48px;
    }

    .lang-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
