/*
 * Единый стиль страниц авторизации, регистрации и подтверждения почты.
 * Базируется на палитре и типографике main.css: тёмный #333, акцент #ff5644,
 * Montserrat, скругления 5–8px, светлые бордеры.
 */

.auth-page {
    --auth-dark: #333;
    --auth-accent: #ff5644;
    --auth-accent-dark: #e94a37;
    --auth-muted: #757575;
    --auth-border: #d8d8d8;
    --auth-soft: #fafafa;

    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 28px;
    align-items: stretch;
    max-width: 1040px;
    margin: 0 auto;
}

/* main.css не задаёт box-sizing — иначе поля с padding вылезают за карточку */
.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

/* Колонки грида не должны раздвигаться длинным содержимым */
.auth-page > * {
    min-width: 0;
}

/* ---------- Карточка формы ---------- */

.auth-card {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .07);
    padding: 34px 36px 30px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--auth-accent);
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-dark);
    line-height: 1.2;
}

.auth-subtitle {
    margin: 10px 0 26px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--auth-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
}

/* ---------- Поля ---------- */

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #555;
}

.auth-field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--auth-border);
    border-radius: 5px;
    background: #fff;
    color: var(--auth-dark);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.auth-field input::placeholder {
    color: #a6a6a6;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(255, 86, 68, .15);
}

.auth-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #8a8a8a;
}

/* Поле с кнопкой «показать/скрыть пароль» */
.auth-input {
    position: relative;
}

.auth-input input {
    padding-right: 48px;
}

.auth-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #9a9a9a;
    font-size: 15px;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}

.auth-eye:hover {
    color: var(--auth-accent);
    background: #f7f7f7;
}

/* ---------- Блок предложенного пароля ---------- */

.password-suggest {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #fff6f4;
    border: 1px dashed #ffb3a8;
    border-radius: 6px;
}

.password-suggest__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.password-suggest__title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #a8433a;
}

.password-suggest__badge {
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(255, 86, 68, .12);
    color: #d04432;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.password-suggest__row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.password-suggest__value {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #ffd5cd;
    border-radius: 5px;
    background: #fff;
    color: var(--auth-dark);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.password-suggest__action {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid #ffd5cd;
    border-radius: 5px;
    background: #fff;
    color: #d04432;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.password-suggest__action:hover {
    background: #ffe7e2;
    color: #a8433a;
}

.password-suggest__hint {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #8a6a64;
}

/* ---------- Сообщения ---------- */

.auth-error,
.auth-notice,
.auth-test {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.55;
}

.auth-error {
    background: #fdecea;
    border-left: 3px solid #d93025;
    color: #b3261e;
}

.auth-notice {
    background: #e8f5e9;
    border-left: 3px solid #2e7d32;
    color: #1e6b30;
}

.auth-test {
    display: block;
    background: #fff8e1;
    border: 1px dashed #f0c36d;
    color: #6d4c00;
}

.auth-error i,
.auth-notice i {
    margin-top: 3px;
}

.auth-error__link {
    color: #b3261e;
    font-weight: 600;
    text-decoration: underline;
}

.auth-test__code {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 10px;
    border: 1px solid #f0c36d;
    border-radius: 4px;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
}

/* ---------- Кнопка и подписи ---------- */

.btn.auth-submit {
    display: block;
    width: 100%;
    height: 48px;
    margin: 8px 0 0;
    background: var(--auth-accent);
    font-weight: 600;
    letter-spacing: .02em;
    transition: background .2s ease, box-shadow .2s ease;
}

.btn.auth-submit:hover {
    transform: none;
    background: var(--auth-accent-dark);
    box-shadow: 0 10px 22px rgba(255, 86, 68, .28);
}

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

.auth-alt {
    margin-top: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--auth-muted);
}

.auth-alt a {
    color: var(--auth-accent);
    font-weight: 600;
}

.auth-alt a:hover {
    color: var(--auth-dark);
}

.auth-alt__sep {
    margin: 0 8px;
    color: #bbb;
}

/* ---------- Код подтверждения ---------- */

.auth-code {
    height: 56px !important;
    padding-left: .45em !important;
    font-size: 24px !important;
    font-weight: 600;
    letter-spacing: .45em;
    text-align: center;
}

.auth-code::placeholder {
    letter-spacing: .45em;
    color: #c9c9c9;
}

.auth-resend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.auth-linkbtn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--auth-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.auth-linkbtn:hover {
    color: var(--auth-dark);
}

.auth-linkbtn:disabled {
    color: #b9b9b9;
    text-decoration: none;
    cursor: not-allowed;
}

.auth-resend__timer {
    font-size: 12px;
    color: #8a8a8a;
}

/* ---------- Боковая панель ---------- */

.auth-aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 34px 30px;
    border-radius: 8px;
    background: linear-gradient(160deg, #333 0%, #262626 100%);
    color: #fff;
    overflow: hidden;
}

.auth-aside__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-aside__logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--auth-accent);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.auth-aside__name {
    font-size: 16px;
    font-weight: 700;
}

.auth-aside__caption {
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #b9b9b9;
}

.auth-aside__list {
    list-style: none;
}

.auth-aside__list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-size: 13.5px;
    color: #e6e6e6;
}

.auth-aside__list li:last-child {
    border-bottom: 0;
}

.auth-aside__list i {
    width: 18px;
    text-align: center;
    color: var(--auth-accent);
    font-size: 14px;
}

.auth-aside__note {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px dashed rgba(255, 255, 255, .15);
    font-size: 12px;
    line-height: 1.6;
    color: #a9a9a9;
}

/* ---------- Адаптив ---------- */

/* Планшет: немного уменьшаем отступы, чтобы формы не «дышали» слишком широко */
@media (max-width: 1024px) {
    .auth-page {
        gap: 22px;
    }

    .auth-card {
        padding: 30px 28px 26px;
    }

    .auth-aside {
        padding: 30px 24px;
    }
}

/* Узкие планшеты и телефоны в портретной ориентации: одна колонка.
   Боковая панель скрывается — форма важнее, а её содержимое есть в меню. */
@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .auth-aside {
        display: none;
    }
}

/* Телефоны */
@media (max-width: 600px) {
    .auth-page {
        gap: 0;
        max-width: 100%;
    }

    .auth-card {
        padding: 22px 18px 20px;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    }

    .auth-kicker {
        font-size: 10.5px;
    }

    .auth-title {
        font-size: 23px;
    }

    .auth-subtitle {
        margin: 8px 0 20px;
        font-size: 13.5px;
        line-height: 1.55;
    }

    .auth-field {
        margin-bottom: 14px;
    }

    /* 16px — иначе iOS зумит страницу при фокусе на поле */
    .auth-field input {
        height: 48px;
        font-size: 16px;
    }

    .auth-field label {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .auth-eye {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .auth-hint {
        font-size: 11.5px;
    }

    .btn.auth-submit {
        height: 50px;
        font-size: 15px;
    }

    .password-suggest {
        padding: 11px 12px;
    }

    .password-suggest__head {
        gap: 8px;
    }

    .password-suggest__value {
        font-size: 15px;
    }

    .password-suggest__action {
        width: 40px;
        height: 40px;
    }

    .password-suggest__hint {
        font-size: 11.5px;
    }

    .auth-error,
    .auth-notice,
    .auth-test {
        padding: 10px 12px;
        font-size: 12.5px;
    }

    .auth-test__code {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .auth-code {
        height: 54px !important;
        font-size: 22px !important;
        letter-spacing: .38em;
    }

    .auth-code::placeholder {
        letter-spacing: .38em;
    }

    .auth-alt {
        margin-top: 16px;
        font-size: 12.5px;
    }

    .auth-resend {
        gap: 6px 10px;
    }
}

/* Очень узкие телефоны */
@media (max-width: 380px) {
    .auth-card {
        padding: 18px 14px 16px;
    }

    .auth-title {
        font-size: 21px;
    }

    .auth-code {
        font-size: 20px !important;
        letter-spacing: .3em;
    }

    .auth-code::placeholder {
        letter-spacing: .3em;
    }

    .password-suggest__head {
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* Короткие экраны (телефон в альбомной ориентации): убираем большой отступ сверху,
   иначе форма уезжает под сгиб */
@media (max-height: 560px) and (max-width: 900px) {
    .main {
        margin-top: 12px;
    }

    .auth-card {
        padding-top: 20px;
    }
}
