/*
 * The kit's own pages in the brand: sign in, create account, two-factor,
 * account, security and the control panel pages that ship with the kit.
 * Their markup is the kit's class-hook contract (docs/theming.md); these rules
 * dress those hooks with the theme's tokens. Everything is scoped to .page,
 * the wrapper every kit view has, so marketing and dashboard components that
 * share a name (.section, .card, .stats) keep their own look.
 */

.page { display: flex; flex-direction: column; gap: 20px; }
.page__header { display: flex; flex-direction: column; gap: 8px; }
.page__title { font-size: clamp(24px, 3vw, 32px); }
.page__lead { color: var(--muted); font-size: 16px; }
.page__text { color: var(--muted); }
.page--error, .page--maintenance { text-align: center; align-items: center; padding: 8px 0; }
.page--error .page__title { font-size: clamp(56px, 12vw, 96px); color: var(--accent); }

.page .section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.page .section__title { font-size: 18px; font-weight: 600; }
.page h3.section__title { font-size: 15px; margin-top: 6px; }
.page .section__text { color: var(--muted); }
.page details.section > summary.section__title { color: var(--accent); font-size: 15px; }

/* Sign-in pages: sections are quiet dividers, buttons fill the width. */
.page--auth { gap: 18px; }
.page--auth .section { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0 0; }
.page--auth .btn:not(.btn--link) { width: 100%; }

.page .form { display: flex; flex-direction: column; gap: 14px; margin: 0; max-width: 560px; }
.page .form > .btn { align-self: flex-start; }
.page--auth .form { max-width: none; }
.page--auth .form > .btn { align-self: stretch; }
.page .table-wrap .form, .page .form--inline { max-width: none; }
.page .form--inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.page .form--inline .field { flex: 1 1 200px; }
.page .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page .actions__form { margin: 0; display: inline; }
.page .links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; font-size: 15px; }
.page .captcha { min-height: 65px; }
.page [data-passkey-status] { color: var(--muted); font-size: 14px; margin: 0; }

.page details > summary { cursor: pointer; list-style: none; }
.page details > summary::-webkit-details-marker { display: none; }
.page details[open] > summary { margin-bottom: 12px; }

.page .alert { margin: 0; }

/* Control panel start page: one card per entry of .inc/admin.php */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card--link { display: block; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card--link:hover { border-color: var(--accent); color: inherit; }
.card__brand { display: block; font-family: var(--f-display); font-weight: 700; font-size: 18px; color: var(--fg); margin-bottom: 12px; }
.card__text { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.card--auth { width: 100%; }

.page .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.page .stat { border-left: 4px solid var(--line-2); }
.stat--ok { border-left-color: var(--success) !important; }
.stat--warn { border-left-color: var(--warning) !important; }
.stat--fail { border-left-color: var(--danger) !important; }

.badge--on { background: rgba(61, 220, 132, .14); color: var(--success); }
.badge--off, .badge--warn { background: rgba(255, 200, 97, .14); color: var(--warning); }
.badge--fail { background: rgba(255, 107, 122, .14); color: var(--danger); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tag { font-family: var(--f-mono); font-size: 13px; padding: 2px 8px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line); }
.tag--grant { color: var(--success); }
.tag--deny { color: var(--danger); }

.table--checks th[scope=row] { width: 220px; font-weight: 600; }
.table--checks td:nth-child(2) { width: 1%; }
.table__pre { white-space: pre-wrap; word-break: break-word; font-family: var(--f-mono); font-size: 13px; }
.log { margin: 0; padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); overflow-x: auto; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-all; }

.code-list { columns: 2; padding-left: 24px; margin: 0; }
.code-list__item { margin-bottom: 6px; }
.qr-code { margin: 0; }
.qr { display: block; width: 220px; height: auto; max-width: 100%; border-radius: var(--r-sm); background: #fff; } /* stays black on white so every phone reads it */

.pagination__current { color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
    .code-list { columns: 1; }
}

/* The kit marks system-check rows with .check; the theme's .check is the checkbox label. */
tr.check { display: table-row; gap: 0; cursor: auto; font-size: inherit; color: inherit; }
tr.check > th, tr.check > td { vertical-align: top; }
.table--checks .badge { white-space: nowrap; }
