.auth-page {
    background: #f6f9fb;
}

.header-link {
    padding: 8px 0;
    color: #526b7c;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.header-link:hover {
    color: #25394a;
}

.auth-main {
    display: flex;
    width: min(100%, 560px);
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

.auth-card {
    width: 100%;
    padding: 38px;
    border: 1px solid #e4ebef;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 14px 42px rgba(37, 57, 74, 0.07);
}

.auth-heading {
    margin-bottom: 30px;
}

.auth-heading h1 {
    margin: 0;
    color: #25394a;
    font-family: "Nunito", sans-serif;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.auth-heading > p:not(.auth-kicker) {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.auth-kicker {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label {
    margin-top: 8px;
    color: #344d5e;
    font-size: 13px;
    font-weight: 650;
}

.auth-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #ccd9e1;
    border-radius: 10px;
    background: #fbfdfe;
    color: #25394a;
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-form input:hover {
    border-color: #aebfca;
}

.auth-form input:focus {
    border-color: #62839a;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(98, 131, 154, 0.12);
}

.field-note {
    margin: -3px 0 2px;
    color: var(--muted);
    font-size: 12px;
}

.submit-button,
.secondary-button {
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.submit-button {
    margin-top: 16px;
    border: 1px solid #315f7d;
    background: #315f7d;
    color: #ffffff;
}

.submit-button:hover {
    border-color: #254d68;
    background: #254d68;
    transform: translateY(-1px);
}

.secondary-button {
    border: 1px solid #c6d5df;
    background: #f7fafc;
    color: #315f7d;
}

.secondary-button:hover {
    border-color: #aebfca;
    background: #eef4f7;
}

.auth-switch {
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.auth-switch a {
    color: #315f7d;
    font-weight: 650;
}

.flash-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    padding: 13px 15px;
    border: 1px solid #d8e3e9;
    border-radius: 10px;
    background: #ffffff;
    color: #526b7c;
    font-size: 13px;
    line-height: 1.45;
}

.flash-error {
    border-color: #efd7d7;
    background: #fffafa;
    color: #8b4545;
}

.flash-success {
    border-color: #cfe3d8;
    background: #f8fcfa;
    color: #38694e;
}

.auth-card-message {
    text-align: center;
}

.auth-card-message .auth-heading {
    margin: 0 auto 28px;
}

.account-details {
    display: grid;
    gap: 4px;
    margin-top: 16px;
}

.account-details strong {
    color: #315f7d;
    font-size: 16px;
}

.account-details span {
    color: var(--muted);
    font-size: 14px;
}

.mail-icon,
.account-mark {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 24px;
    place-items: center;
    border-radius: 50%;
    background: #eaf2f6;
    color: #315f7d;
    font-family: "Nunito", sans-serif;
    font-size: 24px;
    font-weight: 800;
}

.resend-form {
    margin-top: 8px;
}

.deleted-register-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.submit-button:focus-visible,
.secondary-button:focus-visible,
.header-link:focus-visible {
    outline: 3px solid rgba(49, 95, 125, 0.22);
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .auth-main {
        padding: 34px max(14px, env(safe-area-inset-right)) max(56px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 15px;
    }

    .auth-heading h1 {
        font-size: 30px;
    }

    .auth-form input {
        min-height: 50px;
        font-size: 16px;
    }

    .submit-button,
    .secondary-button {
        min-height: 48px;
    }

    .header-link {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
    }
}

@media (max-width: 380px) {
    .auth-main {
        padding-right: max(10px, env(safe-area-inset-right));
        padding-left: max(10px, env(safe-area-inset-left));
    }
    .auth-card { padding: 24px 16px; }
    .auth-heading h1 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-form input,
    .submit-button,
    .secondary-button {
        transition: none;
    }
}

/* ======================================================================
   Вход и регистрация по макету «Вход и регистрация.dc.html».
   ====================================================================== */

.auth-main { width: min(100%, 472px); padding: 52px 28px 72px; }
.header-link { color: var(--blue); font-size: 14px; font-weight: 700; }
.header-link:hover { color: var(--blue-dark); }

.auth-card {
    padding: 34px 36px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(16,40,56,.05);
}
.auth-heading { margin-bottom: 26px; }
.auth-kicker { margin: 0; color: #8ba1ab; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.auth-heading h1 { margin: 12px 0 0; font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.auth-heading > p:not(.auth-kicker) { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; font-weight: 600; line-height: 1.55; }

.auth-form { gap: 0; }
.auth-form label { margin-top: 18px; margin-bottom: 8px; color: #40606f; font-size: 12.5px; font-weight: 800; }
.auth-form > label:first-of-type { margin-top: 0; }
.auth-form input {
    height: auto;
    min-height: 50px;
    padding: 14px 16px;
    border-color: #dde7eb;
    border-radius: 11px;
    background: var(--surface);
    font-size: 15px;
    font-weight: 600;
}
.auth-form input:focus { border-color: #9dc0cd; background: var(--surface); box-shadow: 0 0 0 3px rgba(44,95,114,.1); }

/* Поле пароля с кнопкой «Показать» */
.auth-password-field { position: relative; }
.auth-password-field input { padding-right: 104px; }
.auth-password-field button {
    position: absolute;
    top: 50%;
    right: 8px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: #f2f6f7;
    color: #4e6a78;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    transform: translateY(-50%);
}
.auth-password-field button:hover { background: var(--blue-soft); color: var(--blue); }

.field-note { margin: 8px 0 0; color: #8ba1ab; font-size: 12px; font-weight: 600; }
.field-note a { color: var(--blue); font-weight: 700; }
.field-note[data-state="ok"] { color: #1e6449; }
.field-note[data-state="bad"] { color: #8a3a2c; }
.auth-mismatch { color: #8a3a2c; font-weight: 700; }
.auth-mismatch[hidden] { display: none; }

/* Индикатор надёжности пароля */
.auth-strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.auth-strength[hidden] { display: none; }
.auth-strength-track { display: block; overflow: hidden; width: 100%; height: 5px; flex: 1; border-radius: 3px; background: #eef2f4; }
.auth-strength-track > i { display: block; width: 0; height: 5px; border-radius: 3px; background: #c9d7dd; }
.auth-strength-track > i[data-level="short"] { width: 25%; background: #8a3a2c; }
.auth-strength-track > i[data-level="simple"] { width: 45%; background: #6b4e12; }
.auth-strength-track > i[data-level="medium"] { width: 70%; background: #6b4e12; }
.auth-strength-track > i[data-level="strong"] { width: 100%; background: #1e6449; }
.auth-strength b { flex: 0 0 auto; color: #8ba1ab; font-size: 12px; font-weight: 700; }
.auth-strength b[data-level="short"] { color: #8a3a2c; }
.auth-strength b[data-level="simple"], .auth-strength b[data-level="medium"] { color: #6b4e12; }
.auth-strength b[data-level="strong"] { color: #1e6449; }

.submit-button {
    width: 100%;
    min-height: 52px;
    margin-top: 26px;
    padding: 15px 18px;
    border: 0;
    border-radius: 11px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(20,58,74,.2);
}
.submit-button:hover { background: var(--blue-dark); transform: none; }
.auth-switch { margin: 20px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.auth-switch a { color: var(--blue); font-weight: 700; }

.flash { border-radius: 11px; padding: 15px 18px; font-size: 13.5px; font-weight: 600; }
.flash-success { border-color: #cfe6d8; background: #f3faf6; color: #1e6449; }
.flash-error { border-color: #eed2ca; background: #fdf5f3; color: #8a3a2c; }

@media (max-width: 600px) {
    .auth-main { padding: 34px 16px 56px; }
    .auth-card { padding: 26px 20px; border-radius: 15px; }
    .auth-heading h1 { font-size: 29px; }
    .auth-form input { font-size: 16px; }
}
