:root {
    --primary: #00d1b2;
    --primary-dark: #00b89c;
    --error: #ff3860;
    --success: #48c774;
    --warning: #ffdd57;

    --bg-body: #0a0a0a;
    --bg-gradient: radial-gradient(circle at top right, #1a1a1a, #0d0d0d);
    --bg-sidebar: #121212;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-input: rgba(255, 255, 255, 0.03);
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-main: #ffffff;
    --text-muted: #b5b5b5;
    --text-inverse: #000000;

    --border-color: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --bg-body: #f3f4f6;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border-color: #cbd5e1;
    --glass: rgba(255, 255, 255, 0.95);
    --glass-border: #cbd5e1;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --primary: #00b89c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.login-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary), #00b8d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Fallback for browsers that don't support text-fill-color */
@supports not (-webkit-text-fill-color: transparent) {
    h1 {
        background: none;
        color: var(--primary);
    }
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input);
    /* Keep transparent/white */
    box-shadow: 0 0 0 4px rgba(0, 209, 178, 0.1);
}

select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23b5b5b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem !important;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input);
    box-shadow: 0 0 0 4px rgba(0, 209, 178, 0.1);
}

select option {
    background: #121212;
    color: #ffffff;
}

[data-theme="light"] select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
}

[data-theme="light"] select option {
    background: #ffffff;
    color: #1e293b;
}

.btn-login {
    width: 100%;
    background: var(--primary);
    color: #003029;
    /* Keep dark text for contrast on teal button */
    font-weight: 700;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1rem;
}

.btn-login:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 209, 178, 0.3);
}

.alert {
    background: rgba(255, 56, 96, 0.1);
    border: 1px solid rgba(255, 56, 96, 0.2);
    color: var(--error);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(72, 199, 116, 0.15);
    border: 1px solid rgba(72, 199, 116, 0.3);
    color: var(--success);
}

.status-inactive {
    background: rgba(255, 56, 96, 0.15);
    border: 1px solid rgba(255, 56, 96, 0.3);
    color: var(--error);
}

@media (max-width: 992px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        align-items: center;
        justify-content: center;
    }

    .login-container {
        padding: 2rem 1.5rem;
        margin: 2rem;
        max-width: 90%;
    }

    h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 600px) {
    .login-container {
        padding: 2rem 1rem;
        border-radius: 16px;
    }

    input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    .btn-login {
        padding: 0.8rem;
    }
}
