/* TapCard UI kit. Every colour, radius, font and duration comes from the design tokens (--tc-*),
   which ThemeHead writes from the client pack. No hard-coded colours here (a test checks). */

/* ---------- Layers (one z-index scale for the whole app) ---------- */
:root { --tc-z-raised: 5; --tc-z-sticky: 10; --tc-z-card-edit: 20; --tc-z-overlay: 1450; }

/* ---------- Type details ---------- */
h1, h2, h3, .tc-page-header__title, .tc-card__name { text-wrap: balance; letter-spacing: -0.02em; }
p { text-wrap: pretty; }
table, time, .tc-stat strong, .tc-tabular { font-variant-numeric: tabular-nums; }
code, kbd, .tc-mono { font-family: var(--tc-font-mono); }

/* ---------- Icons ---------- */
.tc-icon { display: inline-block; flex: none; vertical-align: middle; }
.tc-icon--xs { width: 16px; height: 16px; }
.tc-icon--sm { width: 18px; height: 18px; }
.tc-icon--md { width: 24px; height: 24px; }
.tc-icon--lg { width: 32px; height: 32px; }
.tc-icon--xl { width: 48px; height: 48px; }
.tc-ml-1 { margin-left: 6px; }

/* ---------- Focus: always visible for keyboard users ----------
   !important because MudBlazor removes the outline on buttons. Text fields keep MudBlazor's own (clear) focus border. */
:is(a, button, [role="button"], summary, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--tc-color-primary-text) 70%, transparent) !important;
    outline-offset: 2px !important;
}

/* ---------- Page header ---------- */
.tc-page-header { margin: 0 0 24px; }
.tc-page-header__back { display: inline-flex; align-items: center; gap: 4px; color: var(--tc-color-text-muted); text-decoration: none; font-size: 14px; margin-bottom: 8px; }
.tc-page-header__back:hover { color: var(--tc-color-primary-text); }
.tc-page-header__row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.tc-page-header__title:focus { outline: none; }
.tc-page-header__title { overflow-wrap: anywhere; font-family: var(--tc-font-heading); font-size: 28px; font-weight: 700; line-height: 1.2; margin: 0; color: var(--tc-color-text); display: flex; align-items: center; gap: 12px; }
.tc-page-header__subtitle { margin: 4px 0 0; color: var(--tc-color-text-muted); }
.tc-page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Content card ---------- */
.tc-content-card { background: var(--tc-color-surface); border: 1px solid var(--tc-surface-border); border-radius: var(--tc-radius-lg); padding: 20px 22px; }
.tc-content-card + .tc-content-card { margin-top: 16px; }
.tc-content-card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tc-content-card__title { font-family: var(--tc-font-body); font-size: 16px; font-weight: 700; margin: 0; color: var(--tc-color-text); }

/* ---------- Form section ---------- */
.tc-form-section { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.tc-form-section__title { font-family: var(--tc-font-body); font-weight: 700; font-size: 15px; color: var(--tc-color-text); padding: 0; margin-bottom: 4px; }
.tc-form-section__description { margin: 0 0 12px; color: var(--tc-color-text-muted); font-size: 14px; }
.tc-form-section__body { display: grid; gap: 12px; }

/* ---------- Empty state ---------- */
.tc-empty-state { text-align: center; padding: 48px 16px; color: var(--tc-color-text); }
.tc-empty-state__icon { color: var(--tc-color-primary-text); opacity: .85; }
.tc-empty-state__title { font-family: var(--tc-font-heading); font-size: 20px; font-weight: 600; margin: 16px 0 4px; }
.tc-empty-state__message { color: var(--tc-color-text-muted); margin: 0 auto; max-width: 42ch; }
.tc-empty-state__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }

/* ---------- Skeleton list ---------- */
.tc-skeleton-list__row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--tc-color-border); }
.tc-skeleton-list__text { flex: 1; }

/* ---------- Chips ---------- */
.tc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--tc-radius-pill); font-size: 12.5px; font-weight: 700; line-height: 20px; white-space: nowrap;
           color: var(--tc-chip-color); background: color-mix(in srgb, var(--tc-chip-color) 12%, var(--tc-color-surface)); }
.tc-chip--neutral { --tc-chip-color: var(--tc-color-text-muted); }
.tc-chip--success { --tc-chip-color: var(--tc-color-success); }
.tc-chip--warning { --tc-chip-color: var(--tc-color-warning); }
.tc-chip--error { --tc-chip-color: var(--tc-color-error); }
.tc-chip--info { --tc-chip-color: var(--tc-color-info); }

/* ---------- Small labels, icon tiles ---------- */
/* Eyebrow: a small mono, upper-case label above a group ("HELP KABELO SIGN IN", "ORGANISATION"). */
.tc-eyebrow { font-family: var(--tc-font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--tc-color-text-muted); margin: 0; }
/* A soft square behind an icon, in the brand colour. */
.tc-icon-tile { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--tc-radius-sm);
    color: var(--tc-color-primary-text); background: color-mix(in srgb, var(--tc-color-primary) 11%, var(--tc-color-surface)); }

/* ---------- Avatar ---------- */
/* Rounded squares, not circles: a less generic look, and the same shape everywhere. */
.tc-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 30%; object-fit: cover; flex: none; }
.tc-avatar--initials { background: color-mix(in srgb, var(--tc-color-primary) 14%, var(--tc-color-surface)); color: var(--tc-color-primary-text); font-weight: 600; font-family: var(--tc-font-heading); }
.tc-avatar--art { overflow: hidden; background: color-mix(in srgb, var(--tc-color-primary) 14%, var(--tc-color-surface)); }
.tc-avatar--art svg { display: block; width: 100%; height: 100%; }
.tc-avatar--xs { width: 24px; height: 24px; font-size: 11px; }
.tc-avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.tc-avatar--md { width: 40px; height: 40px; font-size: 15px; }
.tc-avatar--lg { width: 72px; height: 72px; font-size: 26px; }
.tc-avatar--xl { width: 128px; height: 128px; font-size: 44px; }

/* ---------- Save indicator ---------- */
.tc-save-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--tc-color-text-muted); min-height: 24px; }
.tc-save-indicator--saved { color: var(--tc-color-success); }
.tc-save-indicator--error { color: var(--tc-color-error); }
.tc-spin { animation: tc-spin 900ms linear infinite; }

/* ---------- Animations (all driven by --tc-motion-*, which drop to 0ms under reduce-motion) ---------- */
.tc-anim { display: inline-flex; }
.tc-anim--saved, .tc-anim--copied, .tc-anim--upload-done { animation: tc-pop var(--tc-motion-base) var(--tc-ease) both; }
.tc-anim--card-reveal { animation: tc-rise var(--tc-motion-slow) var(--tc-ease) both; }
.tc-anim--page-enter { animation: tc-rise var(--tc-motion-base) var(--tc-ease) both; display: block; }
.tc-anim--success-big { animation: tc-pop calc(var(--tc-motion-slow) * 2) var(--tc-ease) both; }
.tc-anim--empty-profiles, .tc-anim--empty-search, .tc-anim--error-state { animation: tc-float 3.2s ease-in-out infinite; }
.tc-anim--loading { animation: tc-pulse 1.4s ease-in-out infinite; }
.tc-anim--import-progress { display: block; }

@keyframes tc-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes tc-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes tc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes tc-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .tc-anim, .tc-anim *, .tc-spin { animation: none !important; transition: none !important; }
}

/* Client logo: light "plate" behind a dark logo in dark mode when the pack has no logo-dark file */
.tc-logo { display: inline-flex; align-items: center; }
.tc-logo--text { font-family: var(--tc-font-heading); font-weight: 700; font-size: calc(var(--tc-logo-height, 36px) * .66); line-height: 1.1;
    letter-spacing: -.01em; color: var(--tc-color-text); white-space: nowrap; max-width: min(320px, 80vw); overflow: hidden; text-overflow: ellipsis; }
/* Explicit height + automatic width: client SVG logos often have no width of their own and would otherwise collapse to nothing. */
.tc-logo img { display: block; height: var(--tc-logo-height, 36px); width: auto; max-width: min(260px, 70vw); object-fit: contain; }
@media (prefers-color-scheme: dark) {
    .tc-logo--plate { background: var(--tc-color-text); padding: 6px 10px; border-radius: var(--tc-radius-md); }
}
.tc-logo--plate.tc-logo--always-dark { background: var(--tc-color-text); padding: 6px 10px; border-radius: var(--tc-radius-md); }
