:root {
    --primary: #0078D4;
    --primary-dark: #005A9E;
    --white: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --gray-50: rgba(250, 250, 250, 0.8);
    --gray-100: rgba(245, 245, 245, 0.8);
    --gray-200: rgba(229, 229, 229, 0.5);
    --gray-400: rgba(163, 163, 163, 0.8);
    --gray-600: rgba(82, 82, 82, 0.9);
    --gray-800: rgba(38, 38, 38, 0.9);
    --error: #DC2626;
    --success: #059669;
    --radius: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--white);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Фон с более светлым градиентом */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4DABF5 0%, #339AF0 50%, #228BE6 100%);
    z-index: -2;
}

/* Стеклянный эффект для фона */
.glass-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: -1;
}

/* Плавающие элементы для эффекта глубины */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    animation: float 20s infinite ease-in-out;
}

.floating-element:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: 20%;
    animation-delay: 5s;
}

.floating-element:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 30%;
    right: -50px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(20px, -30px);
    }
    50% {
        transform: translate(-15px, 15px);
    }
    75% {
        transform: translate(10px, 25px);
    }
}

/* Основной контейнер */
.auth-container {
    width: 100%;
    max-width: 440px;
    background: var(--glass);
    border-radius: var(--radius);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    padding: 40px 32px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon {
    transform: rotate(10deg) scale(1.05);
}

.logo-text {
    font-size: 22px;
    font-weight: 1000;
    color: var(--white);
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Переключатель форм */
.form-tabs {
    display: flex;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 4px;
}

.form-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-tab.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    color: var(--white);
}

.form-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    text-align: center;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--white);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    border-color: var(--white);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--gray-600);
}

.forgot-password {
    display: block;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--white);
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
    background-color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:active {
    transform: translateY(0);
}

.error-message {
    background-color: rgba(220, 38, 38, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 18px;
    display: none;
    border: 1px solid rgba(220, 38, 38, 0.3);
    backdrop-filter: blur(10px);
}

.success-message {
    background-color: rgba(5, 150, 105, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 18px;
    display: none;
    border: 1px solid rgba(5, 150, 105, 0.3);
    backdrop-filter: blur(10px);
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--white);
    font-size: 14px;
    margin-bottom: 20px;
}

.terms-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--white);
    margin-top: 2px;
}

.terms-checkbox a {
    color: var(--white);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-container {
    animation: fadeIn 0.5s ease-out;
}

.form-content {
    display: none;
}

.form-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 32px 24px;
    }
}

/* === Стили для комбобокса пользователей на странице авторизации === */
.login-combobox-wrapper {
    position: relative;
    width: 100%;
}

.login-combobox {
    position: relative;
}

.login-combobox__trigger {
    position: relative;
    display: flex;
    align-items: center;
}

.login-combobox__trigger .form-input {
    padding-right: 40px;
    cursor: pointer;
}

.login-combobox.open .form-input {
    border-radius: var(--radius) var(--radius) 0 0;
}

.login-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    width: 18px;
    height: 18px;
    pointer-events: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232563eb" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    transition: transform 0.2s ease;
}

.login-combobox.open .login-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.login-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.login-combobox.open .login-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.login-option {
    padding: 10px 16px;
    font-size: 15px;
    color: var(--gray-800);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    list-style: none;
}

.login-option__name {
    min-width: 0;
    flex: 1;
}

.login-option--pending {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.10) 0%, rgba(255, 255, 255, 0.96) 42%);
}

.login-option__status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.16);
    color: #9a6700;
    border: 1px solid rgba(245, 158, 11, 0.28);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.login-option__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.login-option:last-child {
    border-bottom: none;
}

.login-option:hover {
    background-color: rgba(0, 120, 212, 0.1);
}

.login-option.selected {
    background-color: rgba(255, 255, 255, 0.96);
    font-weight: 500;
    border-left: 3px solid var(--primary);
}

.login-option.selected .login-option__status-badge {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.22);
}

.login-option.selected .login-option__status-dot {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.login-option.hidden {
    display: none;
}

.login-option .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    font-weight: 600;
    margin-right: 12px;
    font-size: 12px;
    flex-shrink: 0;
}

.login-options::-webkit-scrollbar {
    width: 6px;
}

.login-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.login-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.login-options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}