/* ==========================================================================
   OWN BUSINESS — Base components
   Reusable building blocks for both parts. Part-specific layout lives in
   prototype/css/ or prelaunch/css/. Naming: .block, .block__part, .block--variant
   ========================================================================== */

/* ---- Logo ----------------------------------------------------------------
   SVG files in shared/brand/ — traced from the client's mixed-case logo
   (option A, chosen 2 Oct 2026; the earlier uppercase files are kept in
   reference/superseded/):
     logo-wordmark.svg        "Own Business" — header
     logo-wordmark-white.svg  same, for dark backgrounds
     logo-lockup.svg          with tagline — footer, hero, social images
   Swap in the designer's master vector files if they are ever supplied.     */
.logo { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.logo img { width: auto; height: 26px; }  /* mixed-case logo (2 Oct) — taller than the old uppercase one */
.logo--lockup img { height: 56px; }
@media (max-width: 480px) { .logo img { height: 22px; } .logo--lockup img { height: 48px; } }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 46px; padding: 0.7rem 1.3rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm); letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover   { border-color: var(--ink); }
.btn:active  { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn:focus-visible { border-radius: var(--radius); }

.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn--gold    { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #c7a66b; border-color: #c7a66b; }
.btn--soft    { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--soft:hover { border-color: var(--ink); }
/* Ghost = a text link with a button's hit area (secondary actions) */
.btn--ghost   { background: transparent; border-color: transparent; padding-inline: var(--space-2); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.btn--ghost:hover { border-color: transparent; text-decoration-color: var(--ink); }
.btn--sm      { min-height: 36px; padding: 0.45rem 0.9rem; font-size: var(--fs-xs); }
.btn--block   { width: 100%; }

/* ---- Pills & badges ----------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.25rem 0.55rem; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.01em; line-height: 1.3;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.pill--score    { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill--verified { background: var(--green-tint); color: var(--green); border-color: transparent; }
.pill--demo     { background: var(--danger-tint); color: var(--danger); border-color: transparent; }

/* Management category badge — use with data-category="full|semi|ready".
   Always rendered with its text label (see prototype/js/data.js → CATEGORIES). */
.badge-cat {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.28rem 0.6rem; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
  line-height: 1.2; white-space: nowrap;
}
.badge-cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-cat[data-category="full"]  { background: var(--cat-full-bg);  color: var(--cat-full-fg); }
.badge-cat[data-category="semi"]  { background: var(--cat-semi-bg);  color: var(--cat-semi-fg); }
.badge-cat[data-category="ready"] { background: var(--cat-ready-bg); color: var(--cat-ready-fg); }
/* Distinct dot shapes so categories differ without relying on colour */
.badge-cat[data-category="semi"]::before  { border-radius: 2px; transform: rotate(45deg); }
.badge-cat[data-category="ready"]::before { background: transparent; border: 1.5px solid currentColor; }

/* OWN Management Verified badge (locked #12 — the only active verification).
   Outlined in green so it reads as a separate fact from the category badge. */
.badge-verified {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.24rem 0.55rem; border-radius: var(--radius-sm);
  border: 1px solid var(--green); background: transparent; color: var(--green);
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
  line-height: 1.2; white-space: nowrap;
}

/* ---- Cards & panels ----------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card--interactive { cursor: pointer; }
.card--interactive:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-3px); }
.card__body { padding: var(--space-5); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 1rem + 1vw, 1.75rem); }
.panel--tint { background: var(--field); border-color: transparent; }

/* Key figure: hairline above, small label, number set in Montserrat.
   No grey tile boxes — figures sit on the page like a term sheet.         */
.stat { border-top: 1px solid var(--line-strong); padding-top: var(--space-3); }
.stat__label { display: block; font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--space-1); }
.stat__value { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---- Forms -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.field__label {
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.005em; color: var(--ink);
}
.field__input, .field select, .field input, .field textarea {
  width: 100%; min-height: 46px; padding: 0.65rem 0.8rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold-tint); border-radius: var(--radius);
}
.field input::placeholder, .field textarea::placeholder { color: var(--subtle); }
.field__hint  { font-size: var(--fs-xs); color: var(--muted); }
.field__error { font-size: var(--fs-xs); color: var(--danger); }
.check { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--fs-sm); line-height: 1.5; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---- Tabs (underline style) — behaviour in prototype/js/ui.js → UI.tabs() -- */
.tabs {
  display: flex; gap: var(--space-6); margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; min-height: 44px; padding: 0.6rem 0; border: 0; background: none;
  font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 500; color: var(--muted);
  transition: color var(--dur) var(--ease);
}
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab:focus-visible { border-radius: var(--radius-sm); }

/* ---- Table -------------------------------------------------------------- */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; } /* relative: keeps visually-hidden labels inside the scroll area */
.table { font-size: var(--fs-sm); }
.table th, .table td { text-align: left; padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-family: var(--font-display); font-size: 0.8125rem; font-weight: 600; color: var(--muted); }

/* ---- Notices ------------------------------------------------------------ */
.notice {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius);
  background: var(--field); color: var(--muted); font-size: var(--fs-sm);
}
.notice--demo { background: var(--danger-tint); color: var(--danger); font-weight: 600; }
.notice--gold { background: var(--gold-tint); color: #5a4224; }

/* ---- Toggle switch (use <button role="switch" aria-checked>) ------------- */
.toggle {
  position: relative; flex: none; width: 48px; height: 28px; padding: 0;
  border: 0; border-radius: var(--radius-pill); background: #cfd0cc;
  transition: background var(--dur) var(--ease);
}
.toggle::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.toggle[aria-checked="true"] { background: var(--green); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }
.toggle:focus-visible { border-radius: var(--radius-pill); }

/* ---- Step chips (wizard progress) --------------------------------------- */
.steps { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.steps li { padding: 0.4rem 0.8rem; border-radius: var(--radius-sm); background: var(--field); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.steps li[aria-current="step"] { background: var(--ink); color: #fff; }

/* ---- Modal — behaviour in prototype/js/ui.js → UI.modal ----------------- */
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center; padding: var(--space-4);
  background: rgba(10, 12, 14, 0.58);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.modal.is-open { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ease), visibility 0s; } /* visible at once so focus can move in */
.modal__dialog {
  width: 100%; max-width: 880px; max-height: min(90vh, 900px); overflow: auto;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  transform: translateY(12px); transition: transform var(--dur) var(--ease);
  overscroll-behavior: contain;
}
.modal.is-open .modal__dialog { transform: none; }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-5); }
.modal__title { margin: var(--space-2) 0 var(--space-1); }
.modal__close {
  flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 1.5rem; line-height: 1;
}
.modal__close:hover { border-color: var(--ink); }
.modal__close:focus-visible { border-radius: var(--radius); }
body.has-modal { overflow: hidden; }
@media (max-width: 640px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal__dialog { border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92vh; }
}

/* ---- Toast (brief confirmation, e.g. "Saved") --------------------------- */
.toast {
  position: fixed; left: 50%; bottom: var(--space-6); z-index: var(--z-toast);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-lg);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
