/* Host-level styles. Shared design lives in Zelarion.UI (tokens.css, base.css).
   The account pages still come from the Visual Studio template and use Bootstrap class names; this
   file gives those names the Zelarion look without loading Bootstrap (ADR 0003). It shrinks as the
   account pages are rewritten (docs/security/template-review.md, gap 10). */

/* Validation */
.valid.modified:not([type=checkbox]) { border-color: var(--z-success); }
.invalid { border-color: var(--z-danger); }
.validation-message, .text-danger { color: var(--z-danger); font-size: 13px; }
.text-success { color: var(--z-success); }
.text-secondary, .text-info { color: var(--z-text-muted); }

.blazor-error-boundary {
    padding: var(--z-space-4);
    border-radius: var(--z-radius-control);
    background: color-mix(in oklab, var(--z-danger) 12%, var(--z-surface));
    color: var(--z-text);
}
.blazor-error-boundary::after { content: "Something went wrong on this part of the page."; }

/* Template layout helpers: one calm column inside the signed-out layout */
.row { display: grid; gap: var(--z-space-6); }
[class*="col-"] { min-width: 0; }
.mb-3 { margin-bottom: var(--z-space-4); }
.mt-2 { margin-top: var(--z-space-2); }
.w-100 { width: 100%; }
.mx-auto { margin-inline: auto; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.font-weight-bold { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--z-hairline); margin: var(--z-space-5) 0; }
h2, h3 { margin-bottom: var(--z-space-2); }

/* Fields: label above the input (the template places it after, so the order is reversed) */
.form-floating { display: flex; flex-direction: column-reverse; gap: var(--z-space-2); }
.form-label, .control-label { font-weight: 500; }
.form-control {
    width: 100%; min-height: 44px; padding: 0 var(--z-space-3);
    background: var(--z-surface); color: var(--z-text);
    border: 1px solid var(--z-hairline-strong); border-radius: var(--z-radius-control);
    font: inherit;
    transition: border-color var(--z-dur-hover) var(--z-ease-out), box-shadow var(--z-dur-hover) var(--z-ease-out);
}
.form-control::placeholder { color: var(--z-text-muted); opacity: .7; }
.form-control:focus { outline: none; border-color: var(--z-accent); box-shadow: 0 0 0 3px var(--z-accent-soft); }
.form-control[disabled] { background: var(--z-surface-2); }
.checkbox label { display: inline-flex; align-items: center; gap: var(--z-space-2); }
.form-check-input { width: 18px; height: 18px; accent-color: var(--z-accent-strong); }
.input-group { display: flex; gap: var(--z-space-2); align-items: center; }

/* Buttons: the same three-shadow treatment as ZButton */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--z-space-2);
    min-height: 44px; padding: 0 var(--z-space-4);
    border: 0; border-radius: var(--z-radius-control);
    font: 500 14px/1 var(--z-font-body); cursor: pointer; touch-action: manipulation;
    color: var(--z-text); background: var(--z-surface);
    box-shadow: inset 0 0 0 1px var(--z-hairline-strong), 0 1px 2px rgb(var(--z-shadow-ink) / .10);
    transition: transform var(--z-dur-hover) var(--z-ease-out), box-shadow var(--z-dur-hover) var(--z-ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); transition-duration: var(--z-dur-press); }
.btn-primary {
    color: var(--z-on-accent);
    background: linear-gradient(180deg, color-mix(in oklab, var(--z-accent-strong) 86%, white), var(--z-accent-strong));
    box-shadow: inset 0 1px 0 var(--z-highlight), 0 1px 2px rgb(var(--z-shadow-ink) / .20),
                0 6px 16px -6px color-mix(in oklab, var(--z-accent-strong) 55%, transparent);
}
.btn-danger { color: var(--z-on-attention); background: var(--z-danger); box-shadow: inset 0 1px 0 var(--z-highlight), 0 1px 2px rgb(var(--z-shadow-ink) / .20); }
.btn-link { background: none; box-shadow: none; color: var(--z-accent-strong); padding: 0; min-height: 0; }

/* Messages */
.alert { padding: var(--z-space-3) var(--z-space-4); border-radius: var(--z-radius-control); background: var(--z-accent-soft); }
.alert-danger { background: color-mix(in oklab, var(--z-danger) 12%, var(--z-surface)); }
.alert-warning { background: color-mix(in oklab, var(--z-warning) 14%, var(--z-surface)); }

/* Account settings menu */
.nav { display: flex; flex-wrap: wrap; gap: var(--z-space-1); padding: 0; margin: 0; list-style: none; }
.nav-pills.flex-column { flex-direction: column; }
.nav-link { display: block; padding: var(--z-space-2) var(--z-space-3); border-radius: var(--z-radius-control); color: var(--z-text-muted); text-decoration: none; }
.nav-link.active { background: var(--z-accent-soft); color: var(--z-accent-strong); }
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: var(--z-space-3); border-bottom: 1px solid var(--z-hairline); text-align: left; }

/* KPI cells are tinted on hover but keep square edges, so the hairlines stay straight */
.z-kpi.z-hoverable { border-radius: 0; }
