/*
 * Auth-server account UI. Palette tokens copied from the th-manager design
 * system (wwwroot/css/th-theme.css) so the login experience matches the apps.
 * Self-contained: a centered card on the themed background.
 */

:root {
    --th-bg: #f4efe7;
    --th-paper: #fffaf2;
    --th-surface: #ffffff;
    --th-ink: #26302c;
    --th-muted: #6f7972;
    --th-faint: #9aa49e;
    --th-line: rgba(43, 55, 50, 0.12);
    --th-teal: #287b75;
    --th-teal-strong: #1f6962;
    --th-red: #b84a3a;
    --th-red-soft: #f7ded9;
    --th-amber-soft: #faedd7;
    --th-amber: #d99732;
    --th-shadow: 0 24px 70px rgba(34, 40, 36, 0.14);
    --th-radius: 8px;
    --th-font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    --th-body-grid-line: rgba(38, 48, 44, 0.045);
    --th-body-glow: rgba(217, 151, 50, 0.18);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    color: var(--th-ink);
    font-family: var(--th-font-body);
    font-size: 14px;
    line-height: 1.5;
    background: linear-gradient(var(--th-body-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--th-body-grid-line) 1px, transparent 1px),
    radial-gradient(circle at top left, var(--th-body-glow), transparent 34rem),
    var(--th-bg);
    background-size: 28px 28px, 28px 28px, auto, auto;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: var(--th-radius);
    box-shadow: var(--th-shadow);
    padding: 32px;
}

.auth-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

/* Language toggle (EN/DE) in the card header. */
.th-lang {
    display: inline-flex;
    flex: none;
    padding: 3px;
    border: 1px solid var(--th-line);
    border-radius: var(--th-radius);
    background: var(--th-paper);
    font-size: 12px;
}

.th-lang-option {
    padding: 5px 9px;
    border-radius: 6px;
    color: var(--th-muted);
    text-decoration: none;
    line-height: 1;
}

.th-lang-option.active {
    color: var(--th-ink);
    background: var(--th-surface);
    box-shadow: 0 1px 4px rgba(34, 40, 36, 0.10);
}

.auth-brand strong {
    font-size: 18px;
    letter-spacing: -0.01em;
}

.auth-brand span {
    color: var(--th-muted);
    font-size: 13px;
}

.auth-card h1 {
    font-size: 20px;
    margin: 0 0 4px;
}

.auth-card .subtitle {
    color: var(--th-muted);
    margin: 0 0 24px;
}

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--th-line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background: var(--th-paper);
    color: var(--th-ink);
}

.form-row input:focus {
    outline: none;
    border-color: var(--th-teal);
    box-shadow: 0 0 0 3px rgba(40, 123, 117, 0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--th-muted);
}

.btn-primary {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 6px;
    background: var(--th-teal);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--th-teal-strong);
}

/* Secondary text links (forgot password, resend confirmation, "request a new link").
   The browser default — bright blue + underline — clashes with the card, so render them as
   quiet teal actions. Primary-button anchors (e.g. "Sign in") opt out via .btn-primary. */
.auth-card a:not(.btn-primary):not(.th-lang-option) {
    color: var(--th-teal);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-card a:not(.btn-primary):not(.th-lang-option):hover {
    color: var(--th-teal-strong);
    text-decoration: underline;
}

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-error {
    background: var(--th-red-soft);
    color: var(--th-red);
}

.alert-info {
    background: var(--th-amber-soft);
    color: #8a6418;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.field-validation-error {
    display: block;
    color: var(--th-red);
    font-size: 12px;
    margin-top: 4px;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--th-faint);
    font-size: 12px;
}
