/* Account / two-factor pages. Tokens mirror django_agent_studio/css/studio-dark.css. */
:root {
    --studio-bg: #141414;
    --studio-sidebar-bg: #181818;
    --studio-surface: #1d1d1d;
    --studio-raised: #272727;
    --studio-hover: #303030;
    --studio-border: #363636;
    --studio-text: #ededed;
    --studio-muted: #ababab;
    --studio-focus: #d4d4d4;
    --studio-danger: #efaaaa;
    --studio-success: #b1c9b5;
    --studio-warning: #d6c09a;
    --studio-primary-btn: #dedede;
    --studio-primary-btn-text: #171717;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.auth-body {
    background: var(--studio-bg);
    color: var(--studio-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--studio-text); }

.auth-skip-link { position: absolute; left: -999px; top: 8px; padding: 8px 12px; background: var(--studio-raised); border-radius: 6px; }
.auth-skip-link:focus { left: 8px; z-index: 10; }

.auth-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 24px; border-bottom: 1px solid var(--studio-border); background: var(--studio-sidebar-bg); }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--studio-text); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--studio-border); border-radius: 7px; }
.auth-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.auth-nav-form { margin: 0; }
.auth-nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--studio-muted); font: inherit; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.auth-nav-link:hover, .auth-nav-link.is-active { background: var(--studio-raised); color: var(--studio-text); }
.auth-nav-link.is-active { border-color: var(--studio-border); }
.auth-nav-link .pi { font-size: 13px; }

.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 48px 16px 64px; }
.auth-main:focus { outline: none; }
.auth-messages { width: 100%; max-width: 420px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.auth-manage .auth-messages, .auth-manage .auth-card { max-width: 640px; }
.auth-message { padding: 10px 14px; border: 1px solid var(--studio-border); border-radius: 8px; background: var(--studio-surface); color: var(--studio-text); font-size: 13px; }
.auth-message-success { border-color: var(--studio-success); }
.auth-message-warning { border-color: var(--studio-warning); }
.auth-message-error { border-color: var(--studio-danger); }

.auth-card { width: 100%; max-width: 420px; padding: 32px 28px; border: 1px solid var(--studio-border); border-radius: 12px; background: var(--studio-surface); }
.auth-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.auth-subtitle { margin: 20px 0 8px; font-size: 14px; font-weight: 600; color: var(--studio-text); }
.auth-text { margin: 0 0 18px; color: var(--studio-muted); }
.auth-text a { color: var(--studio-text); text-decoration: underline; text-underline-offset: 2px; }
.auth-divider { margin: 24px 0; border: 0; border-top: 1px solid var(--studio-border); }

.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-form-body { display: flex; flex-direction: column; gap: 14px; }
.auth-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field-check { flex-direction: row; align-items: center; gap: 10px; }
.auth-label { color: var(--studio-muted); font-size: 12px; font-weight: 500; }
.auth-field-check .auth-label { color: var(--studio-text); font-size: 13px; }
.auth-field input:not([type="checkbox"]):not([type="radio"]), .auth-field textarea, .auth-field select,
.auth-input:not(.auth-check) {
    width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--studio-border); border-radius: 6px;
    background: var(--studio-bg); color: var(--studio-text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus, .auth-field textarea:focus, .auth-field select:focus { outline: none; border-color: var(--studio-focus); box-shadow: 0 0 0 2px rgba(212, 212, 212, .25); }
.auth-field input:disabled, .auth-field input[readonly], .auth-field textarea[readonly] { color: var(--studio-muted); background: var(--studio-raised); }
.auth-field input[type="checkbox"], .auth-field input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--studio-primary-btn); }
.auth-textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; resize: vertical; }
#authenticator_secret, input[name="code"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.auth-help { margin: 0; color: var(--studio-muted); font-size: 12px; }
.auth-errors, .errorlist { margin: 0; padding: 0; list-style: none; color: var(--studio-danger); font-size: 12px; }
.auth-errors ul { margin: 0; padding: 0; list-style: none; }
.has-error input, .has-error textarea { border-color: var(--studio-danger); }
.auth-alert { padding: 10px 14px; border: 1px solid var(--studio-border); border-radius: 8px; background: var(--studio-raised); font-size: 13px; }
.auth-alert-error { border-color: var(--studio-danger); color: var(--studio-danger); }
.auth-alert + .auth-form-body { margin-top: 14px; }

.auth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--studio-focus); }
.auth-btn-primary { background: var(--studio-primary-btn); color: var(--studio-primary-btn-text); }
.auth-btn-primary:hover { background: #ffffff; }
.auth-btn-secondary { border-color: var(--studio-border); background: transparent; color: var(--studio-text); }
.auth-btn-secondary:hover { background: var(--studio-raised); }
.auth-btn-danger { border-color: var(--studio-danger); background: transparent; color: var(--studio-danger); }
.auth-btn-danger:hover { background: rgba(239, 170, 170, .1); }
.auth-btn-link { background: transparent; color: var(--studio-muted); padding: 0 8px; }
.auth-btn-link:hover { color: var(--studio-text); }
.auth-btn-block { width: 100%; }
.auth-button-group { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-button-group.is-vertical { flex-direction: column; }
.auth-button-group.is-vertical .auth-btn { width: 100%; }

.auth-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 0; border-top: 1px solid var(--studio-border); }
.auth-panel:first-of-type, .auth-title + .auth-panel { border-top: 0; }
.auth-panel-main { min-width: 0; }
.auth-panel-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.auth-panel-body .auth-text { margin: 0; font-size: 13px; }
.auth-panel-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.auth-panel-actions .auth-btn { min-height: 34px; padding: 0 12px; font-size: 12px; }

.auth-badge { display: inline-block; padding: 2px 8px; border: 1px solid var(--studio-border); border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--studio-muted); }
.auth-badge-success { border-color: var(--studio-success); color: var(--studio-success); }
.auth-badge-warning { border-color: var(--studio-warning); color: var(--studio-warning); }

.auth-img { display: block; max-width: 100%; }
.auth-qr { width: 200px; height: 200px; margin: 0 auto 8px; padding: 10px; border-radius: 10px; background: #ffffff; }

@media (max-width: 600px) {
    .auth-header { padding: 14px 16px; }
    .auth-main { padding: 24px 12px 48px; }
    .auth-card { padding: 24px 18px; }
    .auth-panel { flex-direction: column; }
    .auth-panel-actions { justify-content: flex-start; }
}
