/*
 * Страницы авторизации (вход / регистрация / восстановление / новый пароль) —
 * редизайн по Figma. Классы сохранены прежними, чтобы не ломать шаблоны.
 * Палитра: navy #27234E, green #28A745.
 */

.auth-page {
    --auth-navy: #27234e;
    --auth-navy-dark: #221e43;
    --auth-green: #28a745;
    --auth-green-dark: #1f8e3b;
    --auth-border: #d0d3d9;
    --auth-text: #343a40;
    --auth-muted: #6c757d;

    max-width: 520px;
    margin: 1rem auto 3rem;
    color: var(--auth-text);
}

.auth-page--wide {
    max-width: 860px;
}

.auth-page * {
    box-sizing: border-box;
}

/* ===== Pill tabs ===== */
.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.auth-tabs__link {
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: var(--auth-text);
    background: #f0f0f2;
    border: 1px solid #e0e0e0;
    transition: background-color .15s ease;
}

.auth-tabs__link:hover {
    background: #e6e6ea;
    text-decoration: none;
    color: var(--auth-text);
}

.auth-tabs__link.is-active {
    background: var(--auth-navy);
    color: #fff;
    border-color: var(--auth-navy);
}

.auth-tabs__link.is-active:hover {
    color: #fff;
    background: var(--auth-navy-dark);
}

/* ===== Title ===== */
.auth-page__title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-navy);
    margin: 0 0 24px;
}

.auth-page__title.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* ===== Card form ===== */
.auth-form {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.auth-page__intro {
    color: var(--auth-muted);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ===== Fields ===== */
.auth-form__field {
    margin-bottom: 18px;
}

.auth-form__field:last-of-type {
    margin-bottom: 0;
}

.auth-form__field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-navy);
    margin-bottom: 8px;
}

.auth-form__field label.is-required::after,
.auth-form__field .is-required::after {
    content: " *";
    color: #d93838;
}

.auth-form__field input[type="text"],
.auth-form__field input[type="email"],
.auth-form__field input[type="tel"],
.auth-form__field input[type="password"],
.auth-form__field input[type="number"],
.auth-form__field select {
    width: 100%;
    padding: 13px 16px;
    font-size: 14px;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    line-height: 1.3;
}

.auth-form__field input:focus,
.auth-form__field select:focus {
    outline: none;
    border-color: var(--auth-navy);
    box-shadow: 0 0 0 3px rgba(39, 35, 78, .1);
}

.auth-form__field input::placeholder {
    color: #9a9da3;
}

.auth-form__hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--auth-muted);
    line-height: 1.4;
}

/* Password with eye toggle */
.auth-form__password {
    position: relative;
}

.auth-form__password input {
    padding-right: 46px;
}

.auth-form__eye {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--auth-muted);
    cursor: pointer;
    padding: 0;
}

.auth-form__eye:hover {
    color: var(--auth-navy);
}

/* Глобальный svg/button-стиль темы перебивает inline stroke — задаём явно. */
.auth-form__eye svg {
    stroke: #6c757d !important;
    fill: none !important;
}

.auth-form__eye:hover svg {
    stroke: #27234e !important;
}

/* Two-column rows (register) */
.auth-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.auth-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

/* Fieldset / details */
.auth-form__fieldset {
    border: none;
    padding: 0;
    margin: 0 0 4px;
}

.auth-form__fieldset legend {
    font-size: 15px;
    font-weight: 700;
    color: var(--auth-navy);
    margin: 8px 0 16px;
    padding: 0;
    border: none;
    width: auto;
}

.auth-form__details {
    margin: 8px 0 18px;
}

.auth-form__details > summary {
    font-size: 15px;
    font-weight: 700;
    color: var(--auth-navy);
    cursor: pointer;
    margin-bottom: 16px;
    list-style: none;
}

.auth-form__details > summary::-webkit-details-marker {
    display: none;
}

/* Upload dropzone (visual only) */
.auth-upload {
    border: 2px dashed var(--auth-border);
    border-radius: 10px;
    padding: 28px;
    text-align: center;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-upload svg {
    display: block;
    margin: 0 auto 8px;
    stroke: var(--auth-muted);
}

.auth-upload__title {
    display: block;
    font-weight: 600;
    color: var(--auth-navy);
    margin-bottom: 4px;
}

.auth-upload__hint {
    display: block;
    font-size: 12px;
}

.auth-upload input[type="file"] {
    display: none;
}

/* Checkboxes */
.auth-form__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
}

.auth-form__checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--auth-navy);
}

.auth-form__checkbox label {
    font-size: 14px;
    color: var(--auth-text);
    line-height: 1.4;
}

/* ===== Buttons ===== */
.auth-form .btn,
.auth-form__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    margin-top: 20px;
}

.auth-form .btn-primary,
.auth-form__btn--navy {
    background: var(--auth-navy);
    color: #fff;
}

.auth-form .btn-primary:hover,
.auth-form__btn--navy:hover {
    background: var(--auth-navy-dark);
    color: #fff;
}

.auth-form__btn--green {
    background: var(--auth-green);
    color: #fff;
}

.auth-form__btn--green:hover {
    background: var(--auth-green-dark);
    color: #fff;
}

.auth-form__btn--ghost {
    background: #fff;
    color: var(--auth-navy);
    border-color: var(--auth-border);
}

.auth-form__btn--ghost:hover {
    background: #f6f6f8;
    color: var(--auth-navy);
}

.auth-form__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-form__actions .auth-form__btn {
    margin-top: 20px;
}

/* Links row under login */
.auth-form__links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.auth-form__link {
    color: var(--auth-navy);
    font-weight: 600;
    text-decoration: none;
}

.auth-form__link:hover {
    text-decoration: underline;
    color: var(--auth-navy);
}

.auth-form__link--center {
    display: block;
    text-align: center;
    margin-top: 18px;
}

/* Resend confirmation collapsible */
.auth-form__resend {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    padding: 16px 24px;
}

.auth-form__resend > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--auth-navy);
}

.auth-form__resend .auth-form {
    border: none;
    box-shadow: none;
    padding: 16px 0 0;
}

.password-confirm-message {
    margin-top: 6px;
    font-size: 13px;
    color: var(--auth-muted);
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .auth-form {
        padding: 24px 18px;
    }

    .auth-form__grid,
    .auth-form__row,
    .auth-form__actions {
        grid-template-columns: 1fr;
    }

    .auth-form__actions .auth-form__btn:first-child {
        margin-top: 8px;
    }
}
