/* ── Auth pages: VS2022 dark theme ──────────────────────── */
:root {
    --c-bg: #1e1e1e;
    --c-panel: #252526;
    --c-border: #3f3f46;
    --c-hover: #37373d;
    --c-sel: #094771;
    --c-txt: #d4d4d4;
    --c-txt-dim: #858585;
    --c-txt-muted: #6a6a6a;
    --c-accent: #007acc;
    --c-accent-hover: #1a8cd8;
    --c-pass: #4caf50;
    --c-fail: #f44336;
    --c-yellow: #dcdcaa;
    --c-blue: #9cdcfe;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--c-bg);
    color: var(--c-txt);
    overflow: hidden;
    user-select: none;
}

input { font-family: inherit; color: inherit; }
button { font-family: inherit; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Page layout ─────────────────────────────────────── */
.auth-page {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--c-bg);
}

.auth-titlebar {
    height: 30px;
    background: #181818;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #111;
    flex-shrink: 0;
}

.auth-titlebar-dots {
    display: flex;
    gap: 6px;
    padding-left: 10px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.auth-titlebar-text {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #555;
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(#2a2a2a 1px, transparent 1px),
        linear-gradient(90deg, #2a2a2a 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}

.auth-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, #007acc18 0%, transparent 70%);
    pointer-events: none;
}

.auth-statusbar {
    height: 22px;
    background: var(--c-accent);
    display: flex;
    align-items: center;
    padding-left: 8px;
    flex-shrink: 0;
}

.auth-statusbar-version {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    padding: 0 8px;
}

.auth-statusbar-copy {
    margin-left: auto;
    padding: 0 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

/* ── Card ────────────────────────────────────────────── */
.auth-card {
    position: relative;
    width: 420px;
    background: var(--c-panel);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    animation: cardIn 0.3s ease;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.auth-card-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--c-border);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--c-accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-logo-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-txt);
}

.auth-logo-sub {
    font-size: 10px;
    color: var(--c-txt-dim);
}

.auth-card-title {
    font-size: 20px;
    font-weight: 300;
    color: var(--c-txt);
    letter-spacing: -0.01em;
}

.auth-card-desc {
    font-size: 12px;
    color: var(--c-txt-dim);
    margin-top: 3px;
}

.auth-card-body {
    padding: 24px 32px 28px;
}

.auth-card-footer {
    padding: 14px 32px;
    border-top: 1px solid var(--c-border);
    text-align: center;
    font-size: 12px;
    color: var(--c-txt-dim);
}

.auth-link {
    color: var(--c-accent);
    cursor: pointer;
}

.auth-link:hover {
    text-decoration: underline;
}

/* ── Form fields ─────────────────────────────────────── */
.auth-field {
    margin-bottom: 14px;
}

.auth-field-label {
    font-size: 11px;
    color: var(--c-txt-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 5px;
}

.auth-field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.auth-field-link {
    font-size: 11px;
    color: var(--c-accent);
    cursor: pointer;
}

.auth-field-link:hover {
    text-decoration: underline;
}

.auth-field-input-wrap {
    display: flex;
    align-items: center;
    background: #1e1e1e;
    border: 1px solid var(--c-border);
    border-radius: 3px;
    padding: 0 10px;
    transition: border-color 0.15s;
}

.auth-field-input-wrap:focus-within {
    border-color: var(--c-accent);
}

.auth-field-input-error {
    border-color: var(--c-fail) !important;
}

.auth-field-input-ok {
    border-color: var(--c-pass) !important;
}

.auth-field-input {
    flex: 1;
    padding: 9px 0;
    font-size: 13px;
    color: var(--c-txt);
    background: transparent;
    border: none;
    outline: none;
}

.auth-field-input::placeholder {
    color: var(--c-txt-muted);
}

.auth-field-eye {
    cursor: pointer;
    color: var(--c-txt-dim);
    font-size: 11px;
    padding: 4px;
    user-select: none;
}

.auth-field-error {
    font-size: 11px;
    color: var(--c-fail);
    margin-top: 3px;
}

/* ── Validation ──────────────────────────────────────── */
.validation-summary {
    background: #3d1f1f;
    border: 1px solid #f4433644;
    border-radius: 3px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--c-fail);
}

.validation-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-message {
    font-size: 11px;
    color: var(--c-fail);
    margin-top: 3px;
}

/* ── Buttons ─────────────────────────────────────────── */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}

.auth-btn-primary {
    background: var(--c-accent);
    color: #fff;
}

.auth-btn-primary:hover:not(:disabled) {
    background: var(--c-accent-hover);
}

.auth-btn-primary:disabled {
    background: #1a5a8a;
    cursor: default;
}

.auth-btn-secondary {
    background: transparent;
    color: var(--c-txt-dim);
    border: 1px solid var(--c-border);
    font-size: 12px;
    font-weight: 400;
}

.auth-btn-secondary:hover:not(:disabled) {
    border-color: #555;
    color: var(--c-txt);
}

/* ── Spinner ─────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.27);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ── Divider ─────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

.auth-divider span {
    font-size: 11px;
    color: var(--c-txt-muted);
}

/* ── Password strength ───────────────────────────────── */
.auth-password-strength {
    display: flex;
    gap: 3px;
    margin-top: 5px;
}

.strength-bar {
    height: 3px;
    flex: 1;
    border-radius: 2px;
    background: #333;
    transition: background 0.2s;
}

.strength-bar.strength-ok {
    background: var(--c-pass);
}

/* ── Status message ──────────────────────────────────── */
.auth-status-message {
    padding: 10px 14px;
    border-radius: 3px;
    margin-bottom: 14px;
    font-size: 12px;
}

.auth-status-success {
    background: #1b3a1f;
    border: 1px solid #4caf5044;
    color: var(--c-pass);
}

.auth-status-error {
    background: #3d1f1f;
    border: 1px solid #f4433644;
    color: var(--c-fail);
}

/* ── Confirm / Success icons ─────────────────────────── */
.auth-icon-success {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1b3a1f;
    border: 1px solid #4caf5044;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.auth-icon-error {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #3d1f1f;
    border: 1px solid #f4433644;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.auth-confirm-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-txt);
    margin-bottom: 6px;
}

.auth-confirm-sub {
    font-size: 12px;
    color: var(--c-txt-dim);
    margin-bottom: 4px;
}

.auth-forgot-hint {
    font-size: 12px;
    color: var(--c-txt-dim);
    margin-bottom: 14px;
    margin-top: -4px;
}

/* ── Blazor error UI ─────────────────────────────────── */
#blazor-error-ui {
    color-scheme: dark;
    background: #b32121;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Code input (single field) ────────────────────────── */
.auth-code-input {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 12px;
    padding-left: 12px;
}
