:root {
    color-scheme: light;
    --bg: #0f172a;
    --panel: #ffffff;
    --line: #dbe2ea;
    --text: #0f172a;
    --muted: #5b6777;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #b91c1c;
    --success: #15803d;
    --shadow: 0 22px 45px rgba(15, 23, 42, 0.16);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 45%, #e2e8f0 100%);
    color: var(--text);
    min-height: 100vh;
}
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}
.auth-card, .auth-chooser {
    width: 100%;
    max-width: 480px;
    background: var(--panel);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 32px;
    border: 1px solid rgba(255,255,255,0.65);
}
.auth-chooser { max-width: 960px; }
.auth-header h1 { margin: 0 0 10px; font-size: 30px; }
.auth-header p { margin: 0; color: var(--muted); line-height: 1.5; }
.auth-form { margin-top: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-weight: 700; }
.field input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
}
.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.auth-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.btn {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: #e2e8f0; color: var(--text); }
.alert {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}
.alert--error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert--success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.auth-links { margin-top: 20px; color: var(--muted); font-size: 14px; }
.auth-links a { color: var(--accent); text-decoration: none; }
.auth-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.auth-role {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    background: #f8fafc;
}
.auth-role:hover { border-color: var(--accent); transform: translateY(-1px); }
.auth-role h2 { margin: 0 0 10px; font-size: 22px; }
.auth-role p { margin: 0; color: var(--muted); line-height: 1.45; }
.auth-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}
.auth-topline a { color: var(--accent); text-decoration: none; font-size: 14px; }
@media (max-width: 640px) {
    .auth-card, .auth-chooser { padding: 24px 18px; border-radius: 18px; }
    .auth-header h1 { font-size: 26px; }
}


.auth-card--wide { max-width: 880px; }
.auth-grid--two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.auth-role__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.auth-role__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.auth-role__button--secondary {
    background: #e2e8f0;
    color: var(--text);
}
.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 110px;
}
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field--checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.field--checkbox input {
    width: auto;
}
.form-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}
.auth-links__row { margin-top: 10px; }
@media (max-width: 760px) {
    .grid-two { grid-template-columns: 1fr; }
}


.field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.field__label-row label {
    margin-bottom: 0;
}
.password-box {
    position: relative;
}
.password-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.password-toggle:hover {
    color: var(--accent-hover);
}
.password-toggle:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
    border-radius: 8px;
}

.auth-role__test {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.5;
}
.auth-role__test code {
    background: rgba(255,255,255,0.9);
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 2px 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #0f172a;
}
.test-access {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.test-access__title {
    font-weight: 800;
    color: #1d4ed8;
    margin-bottom: 8px;
}
.test-access__list {
    display: grid;
    gap: 6px;
}
.test-access__line {
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.45;
}
