/* TRIADA · экраны входа — локальный Apple-слой */

:root {
    --auth-glow: rgba(0, 0, 0, 0.035);
    --auth-card-1: rgba(255, 255, 255, 0.92);
    --auth-card-2: rgba(255, 255, 255, 0.74);
    --auth-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
    --auth-input-bg: rgba(0, 0, 0, 0.045);
    --auth-input-focus: rgba(0, 0, 0, 0.03);
}
html[data-theme="dark"] {
    --auth-glow: rgba(255, 255, 255, 0.055);
    --auth-card-1: rgba(31, 31, 34, 0.78);
    --auth-card-2: rgba(19, 19, 21, 0.72);
    --auth-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    --auth-input-bg: rgba(255, 255, 255, 0.065);
    --auth-input-focus: rgba(255, 255, 255, 0.095);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 600px at 50% -10%, var(--auth-glow), transparent 60%),
        var(--bg-color);
    color: var(--text-main);
    font-family: "SF Pro Display", "SF Pro Text", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 396px;
    padding: 30px;
    border-radius: 28px;
    background: linear-gradient(180deg, var(--auth-card-1), var(--auth-card-2));
    border: 1px solid var(--border-color);
    -webkit-backdrop-filter: blur(32px) saturate(150%);
    backdrop-filter: blur(32px) saturate(150%);
    box-shadow: inset 0 1px 0 var(--ring), var(--auth-shadow);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-logo .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.auth-logo .logo-icon img { width: 100%; height: 100%; object-fit: contain; }
/* Светлая тема: белый знак логотипа иначе не виден на светлой карточке */
html[data-theme="light"] .auth-logo .logo-icon img { filter: invert(1); }

.auth-title {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.045em;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { color: var(--text-muted); font-size: 12.5px; }

.form-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: none;
    border-radius: 12px;
    background: var(--auth-input-bg);
    color: var(--text-main);
    font: 14px/1.3 inherit;
    box-shadow: inset 0 1px 0 var(--ring);
    outline: none;
    transition: background .16s ease, box-shadow .16s ease;
}

.form-control::placeholder { color: var(--text-muted); opacity: .7; }
.form-control:focus { background: var(--auth-input-focus); box-shadow: inset 0 1px 0 var(--ring), 0 0 0 3px var(--ring); }

.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 46px; }
.eye-btn {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.eye-btn:hover { color: var(--text-main); background: var(--fill-1); }
.eye-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    margin-top: 4px;
    border: none;
    border-radius: 999px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font: 600 13.5px/1 inherit;
    cursor: pointer;
    transition: background .18s ease;
}
.btn:hover { background: var(--btn-primary-hover); }
/* Перебиваем розовый ховер и scale из styles.css: монохром, только цвет */
.btn:hover:not(:disabled) { background: var(--btn-primary-hover); }
.btn:active:not(:disabled) { transform: none; }
.btn:disabled { opacity: .55; cursor: default; }

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 12.5px;
}
.auth-link { color: var(--text-muted); text-decoration: none; }
.auth-link:hover { color: var(--text-main); }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
/* Галочка — нейтральная, без розового акцента */
.checkbox-label input { accent-color: var(--text-main); width: 15px; height: 15px; }
html .checkbox-label input[type="checkbox"] { accent-color: var(--text-main); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }

.auth-card .btn-secondary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    border: none;
    border-radius: 999px;
    background: var(--fill-1);
    color: var(--text-main);
    font: 500 12.5px/1 inherit;
    text-decoration: none;
    cursor: pointer;
}
.btn-secondary:hover { background: var(--fill-3); }

.auth-card .alert,
.auth-card [class*="alert"] { border: none; border-radius: 12px; }

@media (max-width: 480px) {
    .auth-wrapper { padding: 20px 14px; align-items: flex-start; padding-top: 48px; }
    .auth-card { padding: 24px; border-radius: 24px; }
    .auth-title { font-size: 26px; }
}
