/* Дизайн-токены взяты напрямую с umaclass.education/auth и umaclass.school
   (проверено через computed styles на живых страницах, 2026-08-17):
   - коралловый #FB9E5B и белая карточка 480px/32px — auth.education
   - тёмный текст #2E3240, тёплый фон #FFFBFA, карточки 13px — umaclass.school
   Шрифт auth-страниц (TT Firs Neue) — платный, публично недоступен, поэтому
   везде используется Onest — это реальный шрифт заголовков umaclass.school,
   доступный через Google Fonts. Логотип — градиент #FFA462→#F2924D (тот же
   оранжевый, что и фон), поэтому на коралловом фоне держится в белой подложке. */

:root {
    --brand-orange: #fb9e5b;
    --brand-orange-dark: #f08a3e;
    --ink: #2e3240;
    --muted: rgba(22, 32, 37, 0.65);
    --bg-warm: #fffbfa;
    --surface: #ffffff;
    --input-bg: #fbfbfb;
    --border: #d5d6d9;
    --radius-card: 32px;
    --radius-tile: 13px;
    --radius-control: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, p {
    margin: 0;
}

/* Коралловый фон с фирменным паттерном — общий для auth-экранов и /cabinet,
   /terms, чтобы весь путь пользователя после /login выглядел одним целым. */
.brand-bg {
    min-height: 100vh;
    background-color: var(--brand-orange);
    background-image: url("/static/images/auth-bg.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

/* ---------- Auth-экраны (login / verify / register) ---------- */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 40px 32px 32px;
}

.auth-card__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.auth-card__hint {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

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

.auth-form input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--ink);
}

.auth-form input:focus {
    outline: 2px solid var(--brand-orange);
    outline-offset: 1px;
    border-color: var(--brand-orange);
}

.btn-primary {
    width: 100%;
    background: var(--brand-orange);
    color: #fff;
    border: none;
    border-radius: var(--radius-control);
    padding: 13px 16px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background: var(--brand-orange-dark);
}

.auth-error {
    background: #fdecea;
    color: #c0392b;
    border-radius: var(--radius-control);
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    appearance: none;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}

.auth-tab.is-active {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #fff;
}

.link-button {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    color: var(--brand-orange-dark);
    text-decoration: underline;
    cursor: pointer;
}

.auth-recover-form {
    text-align: center;
    margin-top: 16px;
}

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

/* ---------- /cabinet, /terms — общая шапка и контейнер ---------- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 24px 0;
    max-width: 640px;
    margin: 0 auto;
}

.page-header__logo-chip {
    background: var(--surface);
    border-radius: 999px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
}

.page-header__logo-chip img {
    height: 18px;
    display: block;
}

.client-type-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.client-type-row label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.client-type-row select {
    appearance: none;
    background: var(--surface);
    border: none;
    border-radius: 999px;
    padding: 8px 32px 8px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%232e3240' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.client-type-row select:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.client-type-pending {
    font-size: 13px;
    color: var(--brand-orange-dark);
    font-weight: 600;
    margin: 8px 0 0;
}

.auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1.4;
}

.auth-form .auth-consent input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    padding: 0;
    background: none;
    border: 1px solid var(--border);
    accent-color: var(--brand-orange);
}

.auth-consent a {
    color: var(--brand-orange-dark);
    text-decoration: underline;
}

.cabinet-header-card {
    background: var(--surface);
    border-radius: var(--radius-tile);
    padding: 20px;
    margin-bottom: 24px;
}

.page-main .cabinet-header-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.cabinet-header-card .page-subtitle {
    color: var(--muted);
    margin: 0;
}

.flash-success {
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-control);
    padding: 8px 12px;
    margin: -12px 0 20px;
    display: inline-block;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

.page-main h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin: 0 0 24px;
}

/* ---------- /cabinet ---------- */

.link-card {
    appearance: none;
    background: var(--surface);
    border: none;
    border-radius: var(--radius-tile);
    padding: 20px;
    margin-bottom: 24px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    display: block;
    font-family: inherit;
    position: relative;
    transition: transform 0.1s ease;
}

.link-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.link-card:hover {
    transform: translateY(-1px);
}

.link-card:active {
    transform: translateY(0);
}

.link-card__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.link-card__copy-hint {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-orange-dark);
    text-transform: none;
    letter-spacing: normal;
}

.link-card__copy-hint.is-copied {
    color: #2e7d32;
}

.link-card__value {
    font-size: 15px;
    word-break: break-all;
    color: var(--ink);
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stat-tile {
    background: var(--surface);
    border-radius: var(--radius-tile);
    padding: 16px;
}

.stat-tile__label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-tile__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
}

.stat-tile--wide {
    grid-column: 1 / -1;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-control);
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.15s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ---------- /terms ---------- */

.terms-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 32px;
    margin-bottom: 24px;
}

.terms-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.terms-card ol {
    margin: 0 0 24px;
    padding-left: 20px;
    line-height: 1.6;
}

.terms-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
}

.terms-card ul {
    margin: 0 0 20px;
    padding-left: 20px;
    line-height: 1.6;
    color: var(--muted);
}

.terms-card ul li {
    margin-bottom: 8px;
}

.terms-card__note {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .auth-card, .terms-card {
        padding: 28px 20px 24px;
    }
}
