/* Auth base — reset + layout shell + shared form elements */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body.auth-body {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hover); }

*:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* ── Header ── */
.auth-header {
    height: 52px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    background: var(--surface);
}

.auth-logo {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    text-decoration: none;
}
.auth-logo:hover { color: var(--text); text-decoration: none; }
.logo-mark { color: var(--text); }
.logo-mark-accent { color: var(--amber); }

/* ── Main ── */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

/* ── Footer ── */
.auth-footer {
    border-top: 1px solid var(--border);
    padding: 14px 24px;
    text-align: center;
}
.auth-footer p { font-size: var(--text-sm); color: var(--text-subtle); }
.auth-footer a { color: var(--text-muted); }
.auth-footer a:hover { color: var(--amber); }

/* ── Shared form-input (hardcoded in forms_auth.py) + fallback for reset forms ── */
.auth-body input[type="text"],
.auth-body input[type="email"],
.auth-body input[type="password"] {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 40px 0 12px;
    font-family: var(--font-ui);
    font-size: var(--text-base);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    -webkit-appearance: none;
    appearance: none;
}
.auth-body input[type="text"]:focus,
.auth-body input[type="email"]:focus,
.auth-body input[type="password"]:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-border);
}
.auth-body input[type="text"]::placeholder,
.auth-body input[type="email"]::placeholder,
.auth-body input[type="password"]::placeholder { color: var(--text-subtle); }

.form-input {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 40px 0 12px;
    font-family: var(--font-ui);
    font-size: var(--text-base);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    -webkit-appearance: none;
    appearance: none;
}
.form-input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-border);
}
.form-input::placeholder { color: var(--text-subtle); }

/* ── Shared form-checkbox (hardcoded in forms_auth.py) ── */
.form-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    accent-color: var(--amber);
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
}

/* ── Shared alerts ── */
.alert-block {
    padding: 10px 14px;
    border-radius: var(--r-md);
    margin-bottom: 18px;
    font-size: var(--text-sm);
    border-left: 3px solid;
    line-height: 1.5;
}
.alert-block.error   { background: var(--red-bg);     border-color: var(--red);          color: var(--red);          }
.alert-block.success { background: var(--green-bg);   border-color: var(--green);        color: var(--green);        }
.alert-block.info    { background: var(--blue-bg);    border-color: var(--blue);         color: var(--blue);         }
.alert-block.warning { background: var(--warning-bg); border-color: var(--warning-text); color: var(--warning-text); }

.field-error {
    margin-top: 5px;
    padding: 6px 10px;
    font-size: var(--text-sm);
    color: var(--red);
    background: var(--red-bg);
    border-left: 2px solid var(--red);
    border-radius: var(--r-sm);
    line-height: 1.4;
}

/* ── Shared submit button ── */
.btn-submit {
    width: 100%;
    height: 38px;
    background: var(--amber);
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background var(--dur) var(--ease);
}
.btn-submit:hover  { background: var(--amber-hover); }
.btn-submit:active { background: var(--amber-hover); }
.btn-submit:disabled {
    background: var(--border-strong);
    color: var(--text-subtle);
    cursor: not-allowed;
}

/* ── Password toggle ── */
.pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 38px;
    width: 38px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--dur) var(--ease);
}
.pw-toggle:hover { color: var(--amber); }
.pw-toggle svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }

/* ── Switch link (войти / зарегистрироваться) ── */
.auth-switch {
    margin-top: 18px;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.auth-switch a { color: var(--amber); font-weight: 500; }
