/* Школа Капитал — страницы авторизации (по дизайн-системе Design Kapital). */

.auth-page {
    margin: 0;
    background: #0A0807;
    font-family: 'Manrope', sans-serif;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    background: #0A0807; /* surface-darkest */
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.auth-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 96px 24px 180px;
}

.auth-logo {
    display: inline-block;
    cursor: pointer;
}
.auth-logo img {
    display: block;
    height: 56px;
    width: auto;
}

.auth-card {
    width: 500px;
    max-width: 100%;
    margin-top: 44px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #161413 0%, #1C1815 100%);
    border-radius: 32px;
    padding: 48px 48px 40px;
    box-shadow: 0 60px 120px -20px rgba(0, 0, 0, 0.7),
                0 30px 90px rgba(252, 77, 33, 0.06),
                inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-title {
    font: 800 40px/1 'Montserrat', sans-serif;
    color: #fff;
    text-align: center;
    margin: 0 0 31px;
}

/* ── Поля ввода (белые, на тёмной карточке) ── */
.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-input-wrap {
    position: relative;
    width: 100%;
}

/* Floating label */
.auth-float-label {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font: 500 16px/1 'Manrope', sans-serif;
    color: #9FA6AD;
    pointer-events: none;
    transition: top 0.15s ease, font-size 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.auth-input-wrap.has-value .auth-float-label,
.auth-input-wrap:focus-within .auth-float-label {
    top: 11px;
    transform: none;
    font-size: 11px;
    color: #6F798B;
}
.auth-input-wrap:focus-within .auth-float-label { color: #FC4D21; }
/* Автозаполнение браузера: поле заполнено, но класса has-value ещё нет — поднимаем лейбл по псевдоклассу */
.auth-input:-webkit-autofill + .auth-float-label,
.auth-input:autofill + .auth-float-label {
    top: 11px;
    transform: none;
    font-size: 11px;
    color: #6F798B;
}

.auth-input {
    width: 100%;
    height: 60px;
    box-sizing: border-box;
    border: none;
    outline: none;
    border-radius: 12px;
    background: #fff;
    padding: 22px 48px 4px 24px;
    font: 500 16px/1.3 'Manrope', sans-serif;
    color: #100F0F;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input::placeholder { color: transparent; }
.auth-input:focus { box-shadow: inset 0 0 0 1.5px #FC4D21; }
.auth-input.is-invalid { box-shadow: inset 0 0 0 1.5px #D5401F; }

/* Clear button (×) */
.auth-clear-btn {
    position: absolute;
    top: 0; right: 0;
    height: 100%;
    padding: 0 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    color: #9FA6AD;
    font-size: 20px;
    line-height: 1;
}
.auth-clear-btn:hover { color: #6F798B; }
.auth-input-wrap.has-value .auth-clear-btn { display: flex; }
/* Hide clear btn when password show/hide btn is present */
.auth-input-wrap:has(.showPasswordButton) .auth-clear-btn { display: none !important; }

.auth-input-wrap .showPasswordButton {
    position: absolute;
    top: 0; right: 0;
    height: 100%;
    padding: 0 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.auth-error {
    display: block;
    font: 500 12px/1.3 'Manrope', sans-serif;
    color: #D5401F;
    margin-top: 6px;
}

/* ── Кнопки ── */
.auth-btn {
    width: 100%;
    height: 60px;
    box-sizing: border-box;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: 600 16px/1 'Montserrat', sans-serif;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}
.auth-btn svg { width: 22px; height: 22px; }
.auth-btn--primary { background: #FC4D21; color: #fff; }
.auth-btn--primary:hover { background: #E73103; }
.auth-btn--primary:disabled,
.auth-btn--primary[disabled] { background: #FDDED8; color: #FBB5A8; cursor: default; }
.auth-btn--secondary { background: #F0F0F0; color: rgba(16, 15, 15, 0.9); }
.auth-btn--secondary:hover { background: #D6D6D6; }

.auth-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Чекбоксы ── */
.auth-checks { display: flex; flex-direction: column; gap: 14px; }
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font: 500 14px/1.45 'Manrope', sans-serif;
    color: rgba(255, 255, 255, 0.82);
}
.auth-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-check__box {
    width: 20px; height: 20px;
    flex-shrink: 0;
    border-radius: 6px;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1.5px #FC4D21;
    background: transparent center/12px 12px no-repeat;
    transition: background 0.12s ease;
}
.auth-check input:checked + .auth-check__box {
    box-shadow: none;
    background-color: #FC4D21;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.auth-check.is-invalid .auth-check__box { box-shadow: inset 0 0 0 1.5px #D5401F; }
.auth-accent { color: #FC4D21; }

/* ── Код подтверждения ── */
.auth-desc {
    margin: 0;
    font: 500 16px/1.5 'Manrope', sans-serif;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}
.auth-code {
    display: flex;
    gap: 14px;
    justify-content: center;
    padding: 8px 0 16px;
}
.auth-code input {
    width: 57px; height: 57px;
    box-sizing: border-box;
    border: none; outline: none;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    font: 700 22px/1 'Manrope', sans-serif;
    color: #100F0F;
    caret-color: #FC4D21;
    -webkit-appearance: none; appearance: none;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow 0.12s ease;
}
.auth-code input::-webkit-outer-spin-button,
.auth-code input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.auth-code input:focus { box-shadow: inset 0 0 0 1.5px #FC4D21; }

/* ── Нижний ряд (чекбокс/ссылки, таймер) ── */
.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.auth-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.auth-graylink {
    font: 500 14px/1.45 'Manrope', sans-serif;
    color: #6F798B;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}
.auth-graylink:hover { color: #C2CAD3; }
.auth-timer { font: 500 14px/1.45 'Manrope', sans-serif; color: #6F798B; max-width: 240px; }

/* ── Юридический блок ── */
.auth-legal {
    position: fixed;
    left: 40px;
    bottom: 36px;
    width: 410px;
    max-width: calc(50vw - 40px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font: 500 13px/1.5 'Manrope', sans-serif;
    color: #6F798B;
    z-index: 1;
}
.auth-legal a { color: #FC4D21; text-decoration: underline; }

/* ── Адаптив ── */
@media (max-width: 640px) {
    .auth-shell { min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
    .auth-bg { position: fixed; }
    .auth-logo img { height: 44px; }
    .auth-inner { padding: 40px 16px 0; }
    .auth-card { padding: 32px 24px 28px; border-radius: 24px; gap: 20px; }
    .auth-title { font-size: 30px; }
    .auth-legal {
        position: static;
        width: 100%;
        max-width: 100%;
        margin: 28px 0 36px;
        padding: 0;
        text-align: center;
        font-size: 12px;
    }
}
