/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Backgrounds */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121c;
    --bg-surface: #1a1a24;

    /* Brand Colors */
    --brand-blue: #0091DA;
    --brand-green: #009639;
    --brand-red: #E4002B;
    --brand-yellow: #F2A900;

    --brand-gradient: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-green) 33%, var(--brand-yellow) 66%, var(--brand-red) 100%);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Layout */
    --border: rgba(255, 255, 255, 0.08);
    --radius-lg: 16px;
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== GRADIENT LINE ========== */
.brand-gradient-line {
    height: 4px;
    width: 100%;
    background: var(--brand-gradient);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 101;
}

/* ========== LOGIN CARD ========== */
.login-card {
    width: 100%;
    max-width: 1200px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 60px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-gradient);
}

/* ========== LOGO AREA ========== */
.login-logo-area {
    text-align: center;
    margin-bottom: 16px;
}

.login-logo {
    height: 52px;
    width: auto;
    margin-bottom: 16px;
}

.login-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== FORM ========== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper-login {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

.input-wrapper-login input {
    width: 100%;
    padding: 18px 18px 18px 52px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
}

.input-wrapper-login input::placeholder {
    color: var(--text-muted);
}

.input-wrapper-login input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 145, 218, 0.15);
}

.input-wrapper-login input:focus~.input-icon,
.input-wrapper-login input:focus+.input-icon {
    color: var(--brand-blue);
}

/* Error state */
.input-group.error .input-wrapper-login input {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
}

.input-group.error .input-icon {
    color: var(--brand-red);
}

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* ========== LOGIN BUTTON ========== */
.btn-login {
    width: 100%;
    padding: 18px;
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.btn-login:hover:not(:disabled) {
    background: #007abc;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 145, 218, 0.4);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-login .btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ========== FEEDBACK MESSAGE ========== */
.login-feedback {
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    min-height: 22px;
    transition: var(--transition);
}

.login-feedback.error {
    color: var(--brand-red);
}

.login-feedback.success {
    color: var(--brand-green);
}

/* ========== FORGOT PASSWORD ========== */
.forgot-password-link {
    text-align: center;
    margin-top: 4px;
}

.forgot-password-link a {
    color: var(--brand-yellow);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password-link a:hover {
    color: #ffbe33;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    .login-card {
        margin: 16px;
        padding: 36px 24px;
    }

    .login-title {
        font-size: 1.3rem;
    }
}

/* ========== VERSION INDICATOR ========== */
.app-version {
    position: fixed;
    bottom: 12px;
    left: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
    z-index: 9999;
    pointer-events: none;
    font-family: inherit;
}