/* ============================================================
   Art CRM — auth screens, ОБЩИЕ ТОКЕНЫ
   Согласовано с дизайн-системой CRM (light-first).
   ============================================================ */

:root {
    /* Поверхности */
    --bg: #faf6ef;
    --bg-soft: #f4efe5;
    --bg-card: #ffffff;
    --bg-card-2: #fbf8f2;
    --bg-input: #f4efe5;
    --bg-input-2: #ece4d3;

    /* Бордеры */
    --border: #eae3d5;
    --border-strong: #d9d0bc;

    /* Текст */
    --text: #2a2622;
    --text-secondary: #595048;
    --text-dim: #8a7f73;
    --text-faint: #b8ae9f;

    /* Бренд (CTA) */
    --brand: #3d3a8e;
    --brand-hover: #5754ae;
    --brand-soft: #e8e6f7;
    --brand-ink: #2d2b6e;

    /* Семантика */
    --green: #4f9d7a;
    --green-bg: #daeddf;
    --green-ink: #2e6849;
    --red: #c75a6e;
    --red-bg: #f7dfe3;
    --red-ink: #8e3a4a;
    --amber: #d4a53d;
    --amber-bg: #f8ebc5;
    --amber-ink: #7a5d14;
    --coral: #e08263;
    --coral-bg: #fbe4d9;
    --coral-ink: #8c3f25;
    --blue: #5a8dd9;
    --blue-bg: rgba(90,141,217,0.14);

    /* Лаванда (календарь/занятия/аватарки) */
    --lavender: #c7c3f0;
    --lavender-soft: #e5e2f8;
    --lavender-ink: #4a4790;

    /* Радиусы / тени */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --radius-sm: var(--r-sm);
    --radius: var(--r-md);
    --radius-lg: var(--r-lg);
    --shadow-1: 0 1px 2px rgba(60,50,40,.04), 0 1px 1px rgba(60,50,40,.03);
    --shadow: 0 4px 12px rgba(60,50,40,.06), 0 2px 4px rgba(60,50,40,.04);
    --shadow-3: 0 18px 40px rgba(60,50,40,.10), 0 6px 14px rgba(60,50,40,.06);

    --shadow-card: var(--shadow);
    --shadow-soft: var(--shadow-1);
}

/* Тёмная — только для toggle, на login по умолчанию light */
[data-theme="dark"] {
    --bg: #14141c;
    --bg-soft: #1c1c26;
    --bg-card: #1e1e2c;
    --bg-card-2: #252532;
    --bg-input: #252532;
    --bg-input-2: #2a2a3a;

    --border: #2a2a3a;
    --border-strong: #3a3a4d;

    --text: #ece8df;
    --text-secondary: #b8b1a3;
    --text-dim: #7a7264;
    --text-faint: #5a5448;

    --brand: #8b88e0;
    --brand-hover: #a5a2eb;
    --brand-soft: rgba(139,136,224,0.18);
    --brand-ink: #c8c6f0;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
    --shadow-3: 0 18px 40px rgba(0,0,0,.6), 0 6px 14px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
}

/* ============================================================
   AUTH PAGE — общий каркас
   ============================================================ */

.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    background: var(--bg);
    position: relative;
}

/* левая панель */
.auth-left {
    flex: 1;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 40px;
}
.auth-left-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    z-index: 5;
    position: relative;
}
.auth-left-brand .mark {
    width: 40px; height: 40px;
    background: var(--brand);
    color: #fff;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 22px;
}
.auth-left-brand .name {
    font-size: 17px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.auth-left-brand .name small {
    display: block; font-weight: 500; font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* правая панель — форма */
.auth-right {
    width: 480px;
    min-height: 100vh;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    padding: 40px 56px;
    position: relative;
    z-index: 2;
    border-left: 1px solid var(--border);
}

.auth-right-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 48px;
    color: var(--text-dim);
}

.auth-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
}
.auth-cta-link:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}
.auth-cta-link::after {
    content: '→';
    font-size: 14px;
    transition: transform 0.15s;
}
.auth-cta-link:hover::after { transform: translateX(2px); }

.auth-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.auth-h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text);
}
.auth-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.auth-sub a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.auth-sub a:hover { text-decoration: underline; }

/* поле */
.auth-field {
    display: flex; flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.auth-field label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.auth-field label.req::after { content: ' *'; color: var(--red); }
.auth-field-input-wrap {
    position: relative;
}
.auth-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: var(--text-faint); }
.auth-input:focus {
    border-color: var(--brand);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.auth-input.has-action { padding-right: 42px; }

.auth-eye {
    position: absolute;
    right: 10px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px;
    background: none; border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm);
}
.auth-eye:hover { color: var(--text); background: var(--bg-soft); }

.auth-row-between {
    display: flex; align-items: center; justify-content: space-between;
    margin: 8px 0 22px;
    font-size: 13px;
}

/* checkbox */
.auth-check {
    display: inline-flex; align-items: center; gap: 9px;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
}
.auth-check input { display: none; }
.auth-check .box {
    width: 18px; height: 18px;
    border-radius: 5px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.auth-check .box svg { opacity: 0; transition: opacity 0.15s; }
.auth-check input:checked + .box {
    background: var(--brand);
    border-color: var(--brand);
}
.auth-check input:checked + .box svg { opacity: 1; }
.auth-check:hover .box { border-color: var(--brand); }

.auth-link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* primary */
.auth-btn {
    width: 100%;
    padding: 13px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
    box-shadow: 0 4px 12px -2px rgba(61,58,142,0.35);
}
.auth-btn:hover { background: var(--brand-hover); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn.gradient {
    /* "gradient" больше не градиент — оставляю класс для обратной совместимости */
    background: var(--brand);
}

/* secondary / social */
.auth-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 22px 0;
    font-size: 11.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-social-btn {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background 0.15s, border-color 0.15s;
}
.auth-social-btn:hover {
    background: var(--bg-soft);
    border-color: var(--border-strong);
}
.auth-social-btn .ico {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
}

/* foot */
.auth-foot {
    margin-top: 32px;
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
}

.auth-legal {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.5;
    margin-top: 18px;
}
.auth-legal a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
}

/* error / success */
.auth-msg-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--red-bg);
    color: var(--red-ink);
    border-radius: var(--r-sm);
    font-size: 13px;
    border-left: 3px solid var(--red);
}
.auth-msg-ok {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--green-bg);
    color: var(--green-ink);
    border-radius: var(--r-sm);
    font-size: 13px;
    border-left: 3px solid var(--green);
}

/* topbar tools (theme + lang) */
.auth-tools {
    position: absolute;
    top: 24px; right: 24px;
    display: flex; gap: 8px; align-items: center;
    z-index: 10;
}
.auth-tools .ico-btn {
    width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    box-shadow: var(--shadow-1);
}
.auth-tools .ico-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--bg-soft);
}
