/* === БАЗА === */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
    height: 100%;
}

/* Фон с плавным градиентом для всех страниц */
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 12px;
    background: linear-gradient(135deg, #1d4ed8, #9333ea, #0ea5e9);
    background-size: 200% 200%;
    animation: bg-flow 18s ease infinite;
    color: #0f172a;
}

@keyframes bg-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Центровка для auth-страниц */
body.auth-body {
    align-items: center;
}

/* Контейнер */

.container {
    width: 100%;
    max-width: 900px;
}

/* Карточки */

.card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 24px 22px;
    box-shadow:
            0 18px 45px rgba(15, 23, 42, 0.45),
            0 0 0 1px rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(18px);
    animation: card-fade-in 0.7s ease-out forwards;
    transform: translateY(12px);
    opacity: 0;
}

@keyframes card-fade-in {
    from {
        transform: translateY(24px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

h1, h2, h3 {
    margin-bottom: 12px;
    color: #0f172a;
}

p {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* === ФОРМЫ === */

label {
    display: block;
    font-size: 14px;
    color: #4b5563;
    margin: 10px 0 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    background: #f8fafc;
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease,
        transform 0.1s ease;
}

input:focus,
select:focus {
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.35), 0 10px 25px rgba(15, 23, 42, 0.25);
    transform: translateY(-1px);
}

input::placeholder {
    color: #9ca3af;
}

/* Чекбоксы и подписи */

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.form-row label.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    margin: 0;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Кнопки */

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    margin-top: 14px;
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease,
        opacity 0.12s ease;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.5);
    min-width: 220px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.7);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.5);
}

button:disabled {
    opacity: 0.65;
    cursor: default;
    box-shadow: none;
}

button.secondary {
    background: #e5e7eb;
    color: #111827;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.6);
}

button.secondary:hover {
    background: #f3f4f6;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.3);
}

/* Сообщения */

.msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
}

.msg.error {
    color: #b91c1c;
}

.msg.success {
    color: #15803d;
}

/* Ссылки */

a {
    color: #4f46e5;
    text-decoration: none;
    font-size: 14px;
}

a:hover {
    text-decoration: underline;
}

/* Небольшой футер ссылок */

.link-row {
    margin-top: 12px;
    font-size: 13px;
    color: #6b7280;
}

.link-row a {
    font-size: 13px;
}

/* === СПЕЦИФИЧНО ДЛЯ АВТОРИЗАЦИИ === */

.auth-card-header {
    text-align: center;
    margin-bottom: 18px;
}

.auth-logo-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #e0f2fe, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: #f9fafb;
    font-weight: 700;
    font-size: 22px;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.6);
}

/* Подсказки */

.hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Разделители */

hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 14px 0;
}

/* Адаптив */

@media (max-width: 640px) {
    .card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    body {
        padding: 16px 10px;
    }
}
