:root {
    --bg: #1a1a1a;
    --bg-card: #222222;
    --bg-input: #1a1a1a;
    --border: #2f2f2f;
    --border-focus: #e53935;
    --text: #e8e8e8;
    --text-dim: #9a9a9a;
    --accent: #e53935;
    --accent-hover: #ff5252;
    --error: #ff5252;
    --radius: 8px;
}

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

html, body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;

    /* центрирование карточки по вертикали и горизонтали */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ---------- Карточка ---------- */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 24px;
    color: var(--text);
    text-align: center;
}

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

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

.form-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    text-transform: lowercase;
}

/* Все инпуты внутри формы — единый стиль */
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.auth-form input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}

.auth-form input::placeholder {
    color: #555;
}

/* Ошибки поля */
.form-field.has-error input {
    border-color: var(--error);
}

.field-errors p {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
}

.field-help {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.4;
}

.field-help ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.field-help li {
    margin-bottom: 2px;
}

/* Общие ошибки формы */
.form-errors {
    padding: 10px 14px;
    background: rgba(229, 57, 53, 0.1);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--error);
}

/* ---------- Кнопка ---------- */
.auth-btn {
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.auth-btn:hover {
    background: var(--accent-hover);
}

.auth-btn:active {
    transform: translateY(1px);
}

/* ---------- Ссылка на логин ---------- */
.auth-alt {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
}

.auth-alt a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-alt a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {
    .auth-card {
        padding: 24px 20px;
    }
    .auth-title {
        font-size: 18px;
    }
    .auth-wrapper {
        max-width: none;
    }
}