/**
 * HR Web Viewer - Стили страницы входа
 * Строгая цветовая схема по требованиям hr_Clinic_App:
 * - Фон: #FFFFFF (белый)
 * - Текст: #1A2A3A (тёмно-синий)
 * - Акцент: #52B4BD (бирюзовый)
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #FFFFFF;
    --text-primary: #1A2A3A;
    --accent: #52B4BD;
    --accent-hover: #3d9aa3;
    --border-color: #e0e5ea;
    --shadow: 0 1px 3px rgba(26, 42, 58, 0.08);
    --shadow-md: 0 3px 8px rgba(26, 42, 58, 0.12);
    --radius: 8px;
}

body {
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    background-color: #f5f7fa;
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #e0e5ea 100%);
}

.login-container {
    background-color: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 36px;
}

.sheets-logo {
    width: 216px;
    height: 72px;
    background: url('https://oclinica.ru/sites/default/files/logo_ugn_200_70.png') no-repeat center center;
    background-size: contain;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.login-title {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 16px;
    color: #5a6a7a;
    text-align: center;
    line-height: 1.5;
}

.alert {
    padding: 16px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert.success {
    background-color: #e8f5e9;
    border-color: var(--accent);
    color: var(--accent-hover);
}

.alert.danger {
    background-color: #fce8e6;
    border-color: #e74c3c;
    color: #c0392b;
}

.alert.info {
    background-color: #f0f7f7;
    border-color: var(--accent);
    color: var(--accent-hover);
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 14px 16px 14px 48px;
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(82, 180, 189, 0.2);
}

.form-input:hover {
    border-color: var(--accent);
}

.form-input::placeholder {
    color: #5a6a7a;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 65%;
    transform: translateY(-50%);
    color: #5a6a7a;
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 65%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #5a6a7a;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 1;
}

.password-toggle:hover {
    background-color: #f0f7f7;
}

.login-button {
    width: 100%;
    height: 52px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    margin-top: 8px;
    font-family: inherit;
}

.login-button:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 2px 6px rgba(82, 180, 189, 0.3);
}

.login-button:active {
    background-color: #2d7a83;
    transform: translateY(1px);
}

.login-button:disabled {
    background-color: #e0e5ea;
    color: #5a6a7a;
    cursor: not-allowed;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #5a6a7a;
    line-height: 1.5;
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    color: #5a6a7a;
}

.security-icon {
    font-size: 16px;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

.language-button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: #5a6a7a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.language-button:hover {
    background-color: #f0f7f7;
}

/* Декоративные элементы */
.decoration {
    position: absolute;
    z-index: -1;
    opacity: 0.1;
}

.decoration-1 {
    top: -50px;
    right: 0px;
    width: 200px;
    height: 200px;
    background: var(--accent);
    border-radius: 50%;
}

.decoration-2 {
    bottom: 0px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: var(--accent-hover);
    border-radius: 50%;
}

/* Адаптивность */
@media (max-width: 480px) {
    .login-container {
        margin: 20px;
        padding: 32px 24px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .login-subtitle {
        font-size: 14px;
    }
    
    .decoration-1,
    .decoration-2 {
        display: none;
    }
    
    .form-input {
        padding: 14px 16px 14px 48px;
    }
}

/* Анимация загрузки */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

/* Эффект при фокусе на поле с иконкой */
.form-input:focus + .input-icon {
    color: var(--accent);
}
