/* Buttons, inputs, cards, pills, status dots, alerts, lists, key-value tables. */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 44px;
    padding: 0 var(--sp-4);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Still pressable (it moves focus to the problem summary, UX-2) but must not read as ready. */
.btn[aria-disabled="true"] {
    opacity: .6;
}

.btn-primary {
    background: var(--brand);
    color: var(--brand-ink);
}

.btn-primary:hover {
    background: var(--brand-dim);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background: var(--bg-card);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--bg-card);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(255, 107, 107, .4);
}

.btn-lg {
    min-height: 52px;
    padding: 0 var(--sp-6);
    font-size: var(--fs-18);
}

.btn-sm {
    min-height: 44px;
    padding: 0 var(--sp-3);
    font-size: var(--fs-14);
}

.btn-block {
    width: 100%;
}

.app .btn,
.app .btn-sm {
    min-height: var(--touch);
}

.inline-form {
    display: inline;
    margin: 0;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: var(--sp-3);
    margin: var(--sp-6) 0;
}

/* cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-6);
    box-shadow: var(--shadow-card);
}

.card-title {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-20);
    margin-bottom: var(--sp-4);
}

.card-title .icon {
    color: var(--brand);
}

.feature-card,
.scanner-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-6);
    box-shadow: var(--shadow-card);
}

.feature-card p:last-child,
.scanner-card p:last-child {
    margin-bottom: 0;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-inset);
    color: var(--brand);
    margin-bottom: var(--sp-4);
}

.scanner-maker {
    font-size: var(--fs-14);
    margin-bottom: var(--sp-1);
}

.scanner-card .pill {
    margin-top: var(--sp-3);
}

/* pills and dots */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-14);
    font-weight: 500;
    line-height: 1.3;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pill-ok {
    background: var(--ok-bg);
    color: var(--ok);
    border-color: rgba(47, 227, 156, .35);
}

.pill-warn {
    background: var(--warn-bg);
    color: var(--warn);
    border-color: rgba(255, 201, 77, .35);
}

.pill-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(255, 107, 107, .35);
}

.pill-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: rgba(93, 184, 255, .35);
}

.pill-muted {
    background: var(--bg-inset);
    color: var(--text-secondary);
    border-color: var(--border);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 0 3px rgba(139, 148, 163, .2);
}

.status-dot-ok {
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(47, 227, 156, .25);
}

.status-dot-warn {
    background: var(--warn);
    box-shadow: 0 0 0 3px rgba(255, 201, 77, .25);
}

.status-dot-danger {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, .25);
}

.status-dot-off {
    background: var(--text-muted);
}

.nfiq {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    background: var(--bg-inset);
}

.nfiq-1 {
    color: var(--nfiq-excellent);
}

.nfiq-2 {
    color: var(--nfiq-good);
}

.nfiq-3 {
    color: var(--nfiq-fair);
}

.nfiq-4 {
    color: var(--nfiq-poor);
}

.nfiq-5 {
    color: var(--nfiq-bad);
}

/* forms */
.form-field {
    display: grid;
    gap: var(--sp-2);
    /* In a multi-column row the field stretches to its tallest sibling; keep the control 48 px. */
    align-content: start;
    margin-bottom: var(--sp-4);
}

.form-field label {
    font-weight: 500;
    color: var(--text);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: var(--touch);
    padding: 0 var(--sp-3);
    font: inherit;
    color: var(--text);
    background: var(--bg-inset);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}

.form-field input:focus-visible {
    border-color: var(--brand);
    box-shadow: var(--focus);
}

.form-field .helper {
    font-size: var(--fs-14);
    color: var(--text-muted);
}

.form-field .error {
    font-size: var(--fs-14);
    color: var(--danger);
}

.check-field {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: var(--touch);
    margin-bottom: var(--sp-4);
    cursor: pointer;
}

.check-field input {
    width: 20px;
    height: 20px;
    accent-color: var(--brand);
}

/* alerts */
.alert {
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: var(--sp-4);
}

.alert .icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(255, 107, 107, .35);
}

.alert-ok {
    background: var(--ok-bg);
    color: var(--ok);
    border-color: rgba(47, 227, 156, .35);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: rgba(93, 184, 255, .35);
}

/* lists */
.check-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--sp-4);
    display: grid;
    gap: var(--sp-2);
}

.check-list li {
    display: flex;
    gap: var(--sp-2);
    align-items: flex-start;
}

.check-list .icon {
    color: var(--brand);
    flex-shrink: 0;
    margin-top: 3px;
}

.plain-list {
    padding-left: 1.1em;
    color: var(--text-secondary);
}

.step-list {
    padding-left: 1.4em;
    display: grid;
    gap: var(--sp-3);
    color: var(--text-secondary);
}

.step-list strong {
    display: block;
    color: var(--text);
}

/* key-value */
.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--sp-2) var(--sp-4);
    margin: 0 0 var(--sp-4);
}

.kv dt {
    color: var(--text-muted);
}

.kv dd {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    overflow-wrap: anywhere;
}

/* price */
.price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-6);
    box-shadow: var(--shadow-card);
}

.price {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-bottom: var(--sp-4);
}

.price-amount {
    font-size: var(--fs-48);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.price-unit {
    color: var(--text-secondary);
}

.empty-state {
    padding: var(--sp-6);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-inset);
}

.empty-state p:last-child {
    margin-bottom: 0;
}

.icon {
    flex-shrink: 0;
}

/* FAQ: visible question and answer pairs (printable, crawlable; FAQPage JSON-LD mirrors them). */
.faq-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--sp-4);
}

.faq-item {
    padding: var(--sp-4) var(--sp-6);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.faq-item h3 {
    font-size: var(--fs-18);
    margin-bottom: var(--sp-2);
}

.faq-item p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Numbered step cards (how it works). */
.step-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-6);
    box-shadow: var(--shadow-card);
}

.step-card h3 {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.step-card p:last-child {
    margin-bottom: 0;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 700;
    font-size: var(--fs-16);
    font-variant-numeric: tabular-nums;
}

/* Checklist with printable boxes (state pages). */
.checklist {
    list-style: none;
    margin: 0 0 var(--sp-4);
    padding: 0;
    display: grid;
    gap: var(--sp-3);
}

.checklist li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.checklist li::before {
    content: "";
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border: 2px solid var(--brand);
    border-radius: var(--radius-sm);
}

.checklist strong {
    display: block;
    color: var(--text);
    margin-bottom: var(--sp-1);
}

/* Callout: one short message with an accent edge. */
.callout {
    padding: var(--sp-4) var(--sp-6);
    border-left: 3px solid var(--brand);
    background: var(--bg-inset);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.callout p:last-child {
    margin-bottom: 0;
}

/* Definition list used for facts (scanner specs, contact details). */
.fact-list {
    margin: 0 0 var(--sp-4);
    display: grid;
    gap: var(--sp-2);
}

.fact-list div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--sp-3);
}

.fact-list dt {
    color: var(--text-muted);
    font-size: var(--fs-14);
    padding-top: 2px;
}

.fact-list dd {
    margin: 0;
    color: var(--text-secondary);
}

.inline-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    font-weight: 500;
}

/* operator app type: helper, error and small text stay readable at arm's length (UX-11) */
.app .form-field .helper,
.app .small {
    font-size: 0.9375rem;
}

.app .form-field .error {
    font-size: var(--fs-16);
}

/* setup problems an account admin fixes (Review, Submit) */
.setup-needed {
    margin-top: var(--sp-4);
    padding: var(--sp-4);
    border: 1px solid rgba(255, 201, 77, .35);
    border-radius: var(--radius-sm);
    background: var(--warn-bg);
}

.setup-needed-title {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-18);
    color: var(--warn);
    margin-bottom: var(--sp-3);
}

.setup-needed-list {
    list-style: none;
    margin: 0 0 var(--sp-2);
    padding: 0;
    display: grid;
    gap: var(--sp-2);
}

.setup-needed-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-3);
    color: var(--text);
}

.setup-needed-fix {
    font-weight: 500;
}

/* loading state before the operator circuit renders (/app is not prerendered) */
.app-boot {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    color: var(--text-secondary);
}

body:has(.app-shell) .app-boot,
body:has(.auth-shell) .app-boot {
    display: none;
}
