:root {
    --bg: #1a1f2e;
    --card: #252b3d;
    --accent: #fff3c8;
    --accent-secondary: #f5b23f;
    --custom-blue: #00c3c4;
    --muted: #9aa4b2;
    --glass: rgba(255,255,255,0.05);
    --border: rgba(255,255,255,0.1);
    --text: #e6eef8;
    --text-dim: #b0b8c4;
    --shadow: rgba(2,6,23,0.6);
}

/* Light theme variables */
body.theme-light {
    --bg: #f8fafc;
    --card: #ffffff;
    --accent: #0ea5e9;
    --accent-secondary: #0284c7;
    --custom-blue: #0ea5e9;
    --muted: #64748b;
    --glass: rgba(255,255,255,0.7);
    --border: rgba(148,163,184,0.2);
    --text: #1e293b;
    --text-dim: #475569;
    --shadow: rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    background-color: var(--bg);
}

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: radial-gradient(1200px 600px at 10% 10%, rgba(168, 148, 0, 0.08), transparent), radial-gradient(1000px 500px at 90% 90%, rgba(196, 193, 0, 0.06), transparent), var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: center;
    justify-content: center;
    /*            padding: 20px;*/
    position: relative;
    overflow: hidden;
}

/* Loading animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26,31,46,0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Main container */
.container {
    width: 100%;
    max-width: 1000px;
    background: rgba(26,31,46,0.7);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px var(--shadow);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

/* Light theme container */
body.theme-light .container {
    background: rgba(255,255,255,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

/* Light theme body background */
body.theme-light {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Background image inversion for light theme - exclude logo */
body.theme-light image:not(.logo-image),
body.theme-light img:not(.logo-image) {
    filter: invert(1) hue-rotate(180deg);
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

/* Theme Toggle Button */
.theme-toggle-container {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    font-size: 14px;
    color: var(--text);
    user-select: none;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.theme-toggle-icon {
    font-size: 16px;
    line-height: 1;
}

.theme-toggle-text {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Light theme adjustments */
body.theme-light .theme-toggle:hover {
    background: rgba(0,0,0,0.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-image {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.kicker {
    display: inline-block;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 12px;
}

.title {
    margin: 0 0 12px 0;
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--text);
    font-weight: 800;
}

.subtitle {
    color: var(--muted);
    font-size: 16px;
    margin: 0;
}

/* User type selection */
.user-type-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

    .user-type-selection.active {
        animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

.user-type-card {
    background: linear-gradient(180deg, var(--glass), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

    .user-type-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .user-type-card:hover::before {
        opacity: 0.05;
    }

    .user-type-card:hover {
        transform: translateY(-4px);
        border-color: var(--accent);
        box-shadow: 0 12px 24px rgba(255, 165, 0, 0.2);
    }

    /* Light theme user type cards */
    body.theme-light .user-type-card {
        background: rgba(255,255,255,0.15);
        border-color: rgba(148,163,184,0.2);
    }

    body.theme-light .user-type-card:hover {
        background: rgba(255,255,255,0.25);
        box-shadow: 0 12px 24px rgba(14,165,233,0.15);
        border-color: var(--accent);
    }

    .user-type-card.selected {
        border-color: var(--accent);
        background: linear-gradient(180deg, rgba(0,168,90,0.1), rgba(0,168,90,0.05));
        transform: translateY(-2px);
    }

.user-type-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    position: relative;
    z-index: 1;
}

.user-type-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.user-type-desc {
    font-size: 14px;
    color: var(--muted);
    position: relative;
    z-index: 1;
}

/* Login form */
.login-form {
    display: none;
    max-width: 400px;
    margin: 0 auto;
}

    .login-form.active {
        display: block;
        animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 30px;
    padding: 8px 0;
    transition: color 0.3s ease;
}

    .back-button:hover {
        color: var(--accent);
    }

.input-group {
    margin-bottom: 20px;
}

.input-field {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

    .input-field:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(0,168,90,0.1);
        background: rgba(255,255,255,0.08);
    }

    /* Light theme input styles */
    body.theme-light .input-field {
        background: rgba(255,255,255,0.15);
        border-color: rgba(148,163,184,0.3);
    }

    body.theme-light .input-field:focus {
        background: rgba(255,255,255,0.25);
        box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
    }

    .input-field::placeholder {
        color: var(--muted);
    }

.login-button, .consultation-button, .recover-password-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #00a85a, #00b84d);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.consultation-button {
    background: linear-gradient(135deg, var(--custom-blue), #00a8b0);
}

.recover-password-button {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-secondary));
    color: #252a32;
}

    .login-button::before, .consultation-button::before, .recover-password-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }

.login-button:hover::before, .consultation-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,168,90,0.3);
}

.recover-password-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 165, 0, 0.2);
}

.consultation-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,195,196,0.3);
}

/* Light theme button styles */
body.theme-light .login-button {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

body.theme-light .login-button:hover {
    box-shadow: 0 8px 20px rgba(14,165,233,0.3);
}

body.theme-light .consultation-button {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

body.theme-light .consultation-button:hover {
    box-shadow: 0 8px 20px rgba(14,165,233,0.3);
}

body.theme-light .recover-password-button {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

body.theme-light .recover-password-button:hover {
    box-shadow: 0 8px 20px rgba(245,158,11,0.3);
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 10px;
    cursor: pointer;
}

    .forgot-password a {
        color: var(--muted);
        text-decoration: none;
        font-size: 14px;
        position: relative;
        transition: color 0.3s ease;
    }

        .forgot-password a:hover {
            color: var(--accent);
        }

        .forgot-password a::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 0;
            height: 2px;
            background: var(--accent);
            transition: width 0.3s ease;
        }

        .forgot-password a:hover::after {
            width: 100%;
        }

.success-message {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #86efac;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.error-message {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

/* Light theme message styles for better contrast */
body.theme-light .success-message {
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.4);
    color: #166534;
    font-weight: 500;
}

body.theme-light .error-message {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    color: #dc2626;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    .title {
        font-size: 28px;
    }

    .user-type-selection {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .user-type-card {
        padding: 24px 16px;
    }
}

/* Hide elements initially */
.hidden {
    display: none !important;
}