/* ==================== RESET & TOKENS ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

:root {
    --green: #FF5400;
    --ink: #242222;
    --ink-2: #0F1114;
    --page-bg: #F5F5F4;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: var(--green); }

.auth {
    display: flex;
    min-height: 100vh;
}

/* сдержанное появление при загрузке */
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes auth-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.auth__box { animation: auth-rise .55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.panel { animation: auth-fade .7s ease .1s both; }

/* ==================== LEFT ==================== */
.auth__left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.auth__box {
    width: 456px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth__brand {
    width: 185px;
    height: auto;
    margin-bottom: 32px;
}

/* Terms card */
.card {
    width: 100%;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 18px 11px rgba(115,115,115,0.05),
        0 8px 8px rgba(115,115,115,0.09),
        0 -4px 8.3px rgba(115,115,115,0.10);
    padding: 35px 32px;
}
.card__head { text-align: center; }
.card__title { font-size: 29px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.15; }
.card__date { font-size: 14px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); margin-top: 5px; }
.card__divider {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--green);
    border-radius: 10px;
    margin-top: 10px;
}
.card__body { position: relative; margin-top: 12px; }
.terms {
    height: 387px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: none;
}
.terms::-webkit-scrollbar { display: none; }
.terms p {
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 12px;
}
.terms p:last-child { margin-bottom: 0; }
.terms a { text-decoration: underline; }
/* затухание текста как индикатор прокрутки:
   нижний градиент — пока ниже есть текст; верхний — когда докрутил вниз */
.card__fade {
    position: absolute;
    left: 0; right: 0;
    height: 104px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}
.card__fade--top {
    top: 0;
    background: linear-gradient(to bottom, #fff, rgba(255,255,255,0));
}
.card__fade--bottom {
    bottom: 0;
    background: linear-gradient(to top, #fff, rgba(255,255,255,0));
}
.card__body.can-up   .card__fade--top    { opacity: 1; }
.card__body.can-down .card__fade--bottom { opacity: 1; }

/* footer: checkbox + continue */
.auth__footer {
    width: 100%;
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.accept {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    border: none;
    background: transparent;
    padding: 0;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.accept__box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: #fff;
    border: 1.5px solid var(--green);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease;
}
.accept__box img { width: 12px; height: 12px; opacity: 0; transition: opacity .15s ease; }
/* бокс остаётся белым, галочка зелёная — видно на белом фоне */
.accept.is-checked .accept__box img { opacity: 1; }
.accept__text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink-2);
}
/* подрагивание, если жмут Continue без принятия контракта */
@keyframes accept-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.accept.shake { animation: accept-shake 0.35s ease; }
.btn-continue {
    width: 100%;
    height: 46px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: background-color .2s ease;
}
.btn-continue:hover { background: #CC4300; }
.btn-continue:disabled { opacity: 0.6; cursor: not-allowed; }

/* ==================== OAUTH CARD (Step 2) ==================== */
.oauth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.oauth-card__title {
    font-size: 29px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-align: center;
    line-height: 1.15;
}
.oauth-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.oauth-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 15px;
    height: 55px;
    border: none;
    border-radius: 8px;
    background: #F0EFEF;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, filter .2s ease;
}
.oauth-btn:not(:disabled):hover { filter: brightness(0.97); }
.oauth-btn:disabled { cursor: not-allowed; }
/* недоступные кнопки (Apple/TikTok/Facebook) темнеют при наведении */
.oauth-btn:disabled:hover { background: #E2E1E1; }
.oauth-btn--primary { background: var(--green); }
.oauth-btn--primary:hover { filter: brightness(1.05); }

.oauth-btn__left { display: flex; align-items: center; gap: 15px; }
.oauth-btn__icon { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.oauth-btn__label { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: #040404; }
.oauth-btn--primary .oauth-btn__label { color: #fff; }

.oauth-badge {
    flex-shrink: 0;
    padding: 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-align: center;
}
.oauth-badge--light { background: #fff; color: #050505; width: 112px; }
.oauth-badge--dark { background: var(--ink); color: #fff; }

.oauth-card__note {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-align: center;
}

/* ==================== RIGHT PANEL ==================== */
.panel {
    position: relative;
    flex-shrink: 0;
    width: 896px;
    max-width: 47vw;
    margin: 32px 35px 32px 0;
    border-radius: 50px;
    overflow: hidden;
    background: #111111;
}
.panel__art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}
.panel__logo {
    position: absolute;
    top: 45px;
    left: 45px;
    width: 280px;
    height: auto;
    z-index: 2;
}
.panel__squiggle { position: absolute; z-index: 2; pointer-events: none; }
.panel__squiggle--1 { top: 24px; right: 40px; width: 150px; }
.panel__squiggle--2 { top: 42%; left: 24px; width: 120px; }
.panel__quote {
    position: absolute;
    left: 45px;
    bottom: 45px;
    width: 806px;
    max-width: calc(100% - 90px);
    color: #fff;
    z-index: 2;
}
.panel__quote-text { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.panel__quote-author { font-size: 32px; font-weight: 500; letter-spacing: -0.02em; margin-top: 15px; }

/* ==================== RESPONSIVE ==================== */

/* --- 2K и большие мониторы --- */
@media (min-width: 2000px) {
    .auth__box { width: 520px; }
    .panel { width: 1040px; max-width: 45vw; }
    .panel__quote-text { font-size: 46px; }
    .panel__quote-author { font-size: 36px; }
    .card__title { font-size: 32px; }
    .oauth-card__title { font-size: 32px; }
}

/* --- Планшеты: панель сверху, форма снизу --- */
@media (max-width: 1100px) {
    .auth { flex-direction: column; }
    .panel {
        width: auto;
        max-width: none;
        margin: 0 20px 20px;
        min-height: 420px;
        order: -1;
    }
    .panel__quote-text { font-size: 30px; }
    .panel__quote-author { font-size: 24px; }
}

/* --- Телефоны --- */
@media (max-width: 560px) {
    .panel { display: none; }           /* на телефоне скрываем правую панель */
    .auth__left { padding: 24px 16px; }
    .auth__brand { width: 160px; }
    .card { padding: 28px 22px; }
    .card__title { font-size: 24px; }
    .oauth-card__title { font-size: 24px; }
    .terms { height: 320px; }
    .panel { min-height: 340px; margin: 0 16px 16px; border-radius: 32px; }
    .panel__logo { width: 200px; top: 28px; left: 28px; }
    .panel__quote { left: 28px; bottom: 28px; max-width: calc(100% - 56px); }
    .panel__quote-text { font-size: 24px; }
    .panel__quote-author { font-size: 20px; }
    .panel__squiggle--1 { width: 110px; }
    .panel__squiggle--2 { width: 90px; }
}

/* --- Маленькие телефоны: чтобы OAuth-кнопки не ломались --- */
@media (max-width: 400px) {
    .oauth-btn { padding: 10px 12px; gap: 8px; height: auto; min-height: 52px; }
    .oauth-btn__left { gap: 10px; min-width: 0; }
    .oauth-btn__label { font-size: 13px; }
    .oauth-badge { font-size: 11px; padding: 8px 10px; }
    .oauth-badge--light { width: auto; }
    .card__title { font-size: 22px; }
    .oauth-card__title { font-size: 22px; }
}

.auth { background: #F5F5F4; }
.channel-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #FFF0E8;
    color: var(--green);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
}
.channel-card__badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}
.channel-card__title {
    font-size: 29px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-align: center;
    line-height: 1.15;
    margin-bottom: 8px;
}
.channel-card__sub {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-align: center;
    opacity: .7;
    margin-bottom: 20px;
}
.channel-field { margin-bottom: 18px; }
.channel-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 8px;
}
.channel-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    outline: none;
    transition: border-color .2s ease;
    background: #fff;
}
.channel-field input:focus { border-color: var(--green); }
.channel-field input.is-invalid { border-color: #e53e3e; }
.channel-err {
    color: #e53e3e;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}
.channel-preview {
    margin-top: 16px;
    background: #F7F5F3;
    border: 1.5px solid #e8e8e8;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.channel-preview img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #FFF0E8;
}
.channel-preview__name {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.channel-preview__meta {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}
.channel-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.btn-ghost {
    width: 100%;
    height: 46px;
    background: #fff;
    color: var(--ink);
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    cursor: pointer;
}
