/* Zanitize web: component classes used alongside the Tailwind utilities in app.css (built from
   tailwind/input.css). Colours use the --c-<palette>-<shade> variables that app.css defines and
   mirrors in dark mode, so these classes follow the colour scheme too. */

:root {
    --z-brand: rgb(var(--c-brand-600));
    --z-brand-strong: rgb(var(--c-brand-700));
    --z-brand-soft: rgb(var(--c-brand-50));
    --z-ink: #0b1220;
    --z-ink-2: #111a2e;
    --z-border: rgb(var(--c-slate-200));
    --z-muted: rgb(var(--c-slate-500));
    --z-danger: rgb(var(--c-rose-600));
    --z-radius: 0.625rem;
    --z-sidebar: 16rem;
    --z-surface-rgb: 255 255 255;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --z-surface-rgb: 15 23 42; }
}
:root[data-theme="dark"] { --z-surface-rgb: 15 23 42; }

html { scroll-behavior: smooth; }
/* Grid items may shrink below their content's width (long code lines, URLs), so a single-column
   grid on a phone never pushes the page wider than the screen. */
.grid > * { min-width: 0; }
body { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; }
code, pre, kbd, .font-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
h1:focus { outline: none; }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    border-radius: var(--z-radius); padding: .55rem 1rem; font-size: .875rem; font-weight: 600;
    line-height: 1.25rem; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
    text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--z-brand); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--z-brand); color: #fff; box-shadow: 0 1px 2px rgba(1,158,143,.25); }
.btn-primary:hover:not(:disabled) { background: #067e74; }
.btn-dark { background: var(--z-ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #1e293b; }
.btn-secondary { background: rgb(var(--z-surface-rgb)); color: rgb(var(--c-slate-900)); border-color: rgb(var(--c-slate-300)); }
.btn-secondary:hover:not(:disabled) { background: rgb(var(--c-slate-50)); border-color: rgb(var(--c-slate-400)); }
.btn-ghost { background: transparent; color: rgb(var(--c-slate-700)); }
.btn-ghost:hover:not(:disabled) { background: rgb(var(--c-slate-100)); }
.btn-danger { background: rgb(var(--z-surface-rgb)); color: var(--z-danger); border-color: rgb(var(--c-rose-200)); }
.btn-danger:hover:not(:disabled) { background: rgb(var(--c-rose-50)); border-color: rgb(var(--c-rose-300)); }
.btn-danger-solid { background: var(--z-danger); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #be123c; }
.btn-sm { padding: .35rem .7rem; font-size: .8125rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ surfaces */
.card { background: rgb(var(--z-surface-rgb)); border: 1px solid var(--z-border); border-radius: .875rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--z-border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-title { font-size: .95rem; font-weight: 600; color: rgb(var(--c-slate-900)); }
.card-body { padding: 1.25rem; }
.card-footer { padding: .875rem 1.25rem; border-top: 1px solid var(--z-border); background: rgb(var(--c-slate-50)); border-radius: 0 0 .875rem .875rem; }

/* ------------------------------------------------------------------ forms */
.label { display: block; font-size: .8125rem; font-weight: 600; color: rgb(var(--c-slate-700)); margin-bottom: .35rem; }
.hint { font-size: .75rem; color: var(--z-muted); margin-top: .3rem; }
.input, .select, .textarea {
    width: 100%; border-radius: .5rem; border: 1px solid rgb(var(--c-slate-300)); background: rgb(var(--z-surface-rgb));
    padding: .5rem .75rem; font-size: .875rem; color: rgb(var(--c-slate-900)); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--z-brand); box-shadow: 0 0 0 3px rgba(6,196,175,.18); }
.textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
.code-editor {
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .8125rem; line-height: 1.6;
    background: #0b1220; color: #e2e8f0; border-color: #1e293b; tab-size: 2; white-space: pre; overflow-wrap: normal;
}
.code-editor:focus { border-color: var(--z-brand); }
.checkbox { width: 1rem; height: 1rem; accent-color: var(--z-brand); }
.validation-message { color: var(--z-danger); font-size: .75rem; margin-top: .25rem; }

/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: 9999px; padding: .125rem .55rem; font-size: .72rem; font-weight: 600; line-height: 1.1rem; }
.badge-green { background: rgb(var(--c-emerald-50)); color: rgb(var(--c-emerald-700)); }
.badge-red { background: rgb(var(--c-rose-50)); color: rgb(var(--c-rose-700)); }
.badge-amber { background: rgb(var(--c-amber-50)); color: rgb(var(--c-amber-700)); }
.badge-slate { background: rgb(var(--c-slate-100)); color: rgb(var(--c-slate-600)); }
.badge-brand { background: var(--z-brand-soft); color: var(--z-brand-strong); }
.badge-violet { background: rgb(var(--c-violet-50)); color: rgb(var(--c-violet-700)); }
.chip { display: inline-flex; align-items: center; gap: .3rem; border-radius: .375rem; padding: .1rem .45rem; font-size: .7rem; font-weight: 600; letter-spacing: .02em; box-shadow: inset 0 0 0 1px var(--tw-ring-color, rgb(var(--c-slate-200))); }

/* ------------------------------------------------------------------ tables */
.table { width: 100%; font-size: .875rem; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--z-muted); font-weight: 600; padding: .65rem 1rem; background: rgb(var(--c-slate-50)); border-bottom: 1px solid var(--z-border); }
.table td { padding: .75rem 1rem; border-bottom: 1px solid rgb(var(--c-slate-100)); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgb(var(--c-slate-50)); }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ navigation */
.side-link { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; color: #cbd5e1; text-decoration: none; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active { background: rgba(6,196,175,.14); color: #5eead4; }
.side-link svg { width: 1.1rem; height: 1.1rem; flex: none; opacity: .85; }
.side-section { padding: 1rem .75rem .35rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; font-weight: 600; }
.top-link { font-size: .9rem; font-weight: 500; color: rgb(var(--c-slate-600)); text-decoration: none; }
.top-link:hover, .top-link.active { color: rgb(var(--c-slate-900)); }
.tab { padding: .5rem .85rem; font-size: .85rem; font-weight: 600; color: var(--z-muted); border-bottom: 2px solid transparent; cursor: pointer; background: none; }
.tab:hover { color: rgb(var(--c-slate-900)); }
.tab.active { color: var(--z-brand-strong); border-color: var(--z-brand); }

/* ------------------------------------------------------------------ marketing */
.hero-grid { background-image: radial-gradient(circle at 1px 1px, rgba(148,163,184,.18) 1px, transparent 0); background-size: 24px 24px; }
.glow { background: radial-gradient(600px circle at 50% 0%, rgba(6,196,175,.22), transparent 60%); }
.prose-docs h2 { font-size: 1.35rem; font-weight: 700; color: rgb(var(--c-slate-900)); margin: 2.25rem 0 .75rem; }
.prose-docs h3 { font-size: 1.05rem; font-weight: 600; color: rgb(var(--c-slate-900)); margin: 1.5rem 0 .5rem; }
.prose-docs p, .prose-docs li { color: rgb(var(--c-slate-600)); line-height: 1.7; }
.prose-docs ul { list-style: disc; padding-left: 1.25rem; margin: .5rem 0 1rem; }
.prose-docs code:not(pre code) { background: rgb(var(--c-slate-100)); border-radius: .25rem; padding: .1rem .35rem; font-size: .85em; color: rgb(var(--c-slate-900)); }

/* ------------------------------------------------------------------ code blocks */
.codeblock { position: relative; background: #0b1220; color: #e2e8f0; border-radius: .75rem; border: 1px solid #1e293b; }
.codeblock pre { padding: 1rem 1.1rem; overflow-x: auto; font-size: .8rem; line-height: 1.65; margin: 0; }
.codeblock .codeblock-bar { display: flex; justify-content: space-between; align-items: center; padding: .45rem .75rem .45rem 1rem; border-bottom: 1px solid #1e293b; font-size: .72rem; color: #94a3b8; }

/* ------------------------------------------------------------------ highlight for anonymized text */
mark.pii { background: rgb(var(--c-amber-100)); color: rgb(var(--c-amber-800)); border-radius: .25rem; padding: 0 .15rem; }
mark.surrogate { background: rgb(var(--c-teal-100)); color: rgb(var(--c-teal-800)); border-radius: .25rem; padding: 0 .15rem; }

/* ------------------------------------------------------------------ modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(2px); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; overflow-y: auto; }
.modal-panel { width: 100%; max-width: 36rem; background: rgb(var(--z-surface-rgb)); border-radius: 1rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,.35); }
.modal-panel.wide { max-width: 56rem; }

/* ------------------------------------------------------------------ misc */
.spinner { width: 1.1rem; height: 1.1rem; border-radius: 9999px; border: 2px solid currentColor; border-right-color: transparent; animation: z-spin .7s linear infinite; display: inline-block; }
@keyframes z-spin { to { transform: rotate(360deg); } }
.bar-track { background: rgb(var(--c-slate-100)); border-radius: 9999px; height: .5rem; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, #06c4af, #019e8f); height: 100%; border-radius: 9999px; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

#blazor-error-ui { display: none; }
#blazor-error-ui .dismiss { cursor: pointer; }
.blazor-error-boundary { background: rgb(var(--c-rose-50)); color: rgb(var(--c-rose-800)); padding: 1rem; border-radius: .5rem; }
.blazor-error-boundary::after { content: "An error occurred while rendering this section."; }
