/* ==========================================================================
   Login Page — стили для страницы авторизации в стиле Telegram
   ========================================================================== */

/* --- Сброс и базовые настройки --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1e1e1e;
    --bg-card: #2f3136;
    --bg-input: #40444b;
    --bg-input-focus: #454950;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #6c6f78;
    --accent: #5b9bd5;
    --accent-hover: #4a8bc5;
    --accent-glow: rgba(91, 155, 213, 0.3);
    --error-bg: rgba(237, 66, 69, 0.12);
    --error-text: #ed4245;
    --error-border: rgba(237, 66, 69, 0.3);
    --border: #40444b;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Контейнер центрирования --- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(91, 155, 213, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(91, 155, 213, 0.04) 0%, transparent 60%),
        var(--bg-primary);
}

/* --- Карточка логина --- */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Иконка --- */
.login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(91, 155, 213, 0.1);
    border-radius: 50%;
    color: var(--accent);
}

/* --- Заголовки --- */
.login-title {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* --- Ошибка --- */
.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 20px;
    color: var(--error-text);
    font-size: 14px;
    line-height: 1.4;
    animation: shake 0.3s ease-out;
}

.login-error svg {
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* --- Форма --- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- Кнопка входа --- */
.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    margin-top: 6px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.login-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn svg {
    transition: transform 0.2s;
}

.login-btn:hover svg {
    transform: translateX(3px);
}

/* --- Футер --- */
.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Адаптивность --- */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 24px;
    }

    .login-title {
        font-size: 20px;
    }

    .login-icon {
        width: 56px;
        height: 56px;
    }

    .login-icon svg {
        width: 32px;
        height: 32px;
    }
}
