/* ==========================================================================
   NISC — components.css
   Buttons, chips, pills, cards, covers, filters, forms, overlays,
   accordion, tabs, lightbox, search, toast, notices, CTA band.
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 700;
  font-size: 0.97rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .i { transition: transform var(--dur) var(--ease); }
.btn:hover .i--arrow { transform: translateX(3px); }
.btn--primary {
  --btn-bg: var(--accent);
  --btn-ink: var(--accent-ink);
  --btn-line: transparent;
  box-shadow: 0 10px 24px -12px rgba(30, 95, 216, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn--primary:hover { --btn-bg: var(--accent-hover); box-shadow: 0 14px 30px -12px rgba(30, 95, 216, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn--secondary:hover { --btn-line: var(--accent); --btn-ink: var(--accent); }
.btn--ghost { --btn-bg: transparent; --btn-line: transparent; --btn-ink: var(--ink-2); }
.btn--ghost:hover { --btn-bg: var(--surface-2); --btn-ink: var(--ink); }
.btn--light { --btn-bg: #FFFFFF; --btn-ink: #0A1B3F; --btn-line: transparent; }
.btn--light:hover { --btn-bg: #EAF3FF; }
.btn--outline-light { --btn-bg: transparent; --btn-ink: #FFFFFF; --btn-line: rgba(255, 255, 255, 0.4); }
.btn--outline-light:hover { --btn-line: #FFFFFF; --btn-bg: rgba(255, 255, 255, 0.08); }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 0.88rem; }
.btn--lg { min-height: 54px; padding: 14px 26px; font-size: 1.03rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-color: var(--accent-ink) var(--accent-ink) transparent transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
}
.link-arrow .i { transition: transform var(--dur) var(--ease); }
.link-arrow:hover { text-decoration: underline; }
.link-arrow:hover .i { transform: translateX(3px); }

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1;
}

/* ---------- Chips, tags, pills ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.chip__count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-3);
}
.chip[aria-pressed="true"] .chip__count { background: rgba(255, 255, 255, 0.16); color: inherit; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.tag--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
:root[data-theme="dark"] .tag--accent { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag--accent { color: var(--brand); } }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill--upcoming { background: var(--sky-soft); color: var(--accent); border-color: transparent; }
:root[data-theme="dark"] .pill--upcoming { color: var(--sky); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill--upcoming { color: var(--sky); } }
.pill--ongoing { background: var(--live-soft); color: var(--live); border-color: transparent; }
.pill--ongoing .pill__dot { animation: pulse 1.4s ease-out infinite; }
.pill--completed { background: var(--surface-2); color: var(--ink-2); }
.pill--open { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill--closed { background: var(--surface-2); color: var(--ink-3); }
.pill--soon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill--template { background: var(--ph-bg); color: var(--ph-ink); border: 1px dashed var(--ph-line); }
.pill--verified { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill--glass { background: rgba(255, 255, 255, 0.9); color: #0A1B3F; border-color: transparent; box-shadow: var(--shadow-sm); }
.pill--glass.pill--ongoing { color: #C8103E; }
.pill--glass.pill--upcoming { color: #1E5FD8; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease), border-color 260ms var(--ease);
}
.card--link:hover, .card--link:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}
.card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.card--link:hover .card__media img { transform: scale(1.04); }
.card__badges { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; z-index: 2; pointer-events: none; }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; flex: 1; }
.card__kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
:root[data-theme="dark"] .card__kicker { color: var(--sky); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card__kicker { color: var(--sky); } }
.card__title { font-size: 1.22rem; line-height: 1.25; }
.card__title a { color: inherit; text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card__link:focus-visible { outline: none; }
.card__link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.card__text { color: var(--ink-2); font-size: 0.97rem; line-height: 1.6; }
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.card__foot .i--arrow { color: var(--accent); transition: transform var(--dur) var(--ease); }
.card--link:hover .card__foot .i--arrow { transform: translateX(4px); }
.card__foot a, .card__body a:not(.card__link) { position: relative; z-index: 2; }

.card--flat { background: var(--surface-2); border-color: transparent; }
.card--pad { padding: clamp(22px, 3vw, 30px); gap: 12px; }
.card--glass { background: var(--surface-glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.card--template { border-style: dashed; border-color: var(--ph-line); }

.icon-tile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
:root[data-theme="dark"] .icon-tile { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-tile { color: var(--brand); } }
.icon-tile .i { width: 24px; height: 24px; }
.icon-tile--sky { background: var(--sky-soft); color: var(--sky); }
.icon-tile--navy { background: var(--band-bg); color: var(--sky-300) !important; }

/* ---------- Generated covers (used when no photo exists) ---------- */
.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 20px;
  overflow: hidden;
  color: #FFFFFF;
  background: linear-gradient(135deg, #0A1B3F 0%, #0B47B1 60%, #1E7FE0 100%);
  isolation: isolate;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 82% 22%, rgba(127, 208, 248, 0.55) 0 3px, transparent 4px),
    radial-gradient(circle at 64% 44%, rgba(127, 208, 248, 0.5) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 90% 62%, rgba(255, 255, 255, 0.45) 0 2px, transparent 3px),
    radial-gradient(70% 90% at 100% 0%, rgba(56, 182, 242, 0.45), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 28px 28px;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(155deg, transparent 52%, rgba(127, 208, 248, 0.35) 52.3%, transparent 52.8%),
              linear-gradient(118deg, transparent 62%, rgba(255, 255, 255, 0.18) 62.2%, transparent 62.6%);
}
.cover__kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.cover__big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.95);
}
.cover__big--text { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.05; letter-spacing: -0.02em; max-width: 14ch; }
.cover--workshop { background: linear-gradient(135deg, #0B3C94 0%, #1E5FD8 55%, #38B6F2 100%); }
.cover--meetup { background: linear-gradient(135deg, #1E5FD8 0%, #2F7CF0 50%, #7FD0F8 100%); }
.cover--competition { background: linear-gradient(135deg, #061231 0%, #102A5C 50%, #0B47B1 100%); }
.cover--community { background: linear-gradient(135deg, #0B47B1 0%, #1BA3E8 100%); }
.cover--project { background: linear-gradient(135deg, #102A5C 0%, #1E5FD8 70%, #38B6F2 110%); }
.cover--story { background: linear-gradient(135deg, #0B47B1 0%, #0A1B3F 100%); }

/* ---------- Date badge ---------- */
.date-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  padding: 6px 8px 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #0A1B3F;
  box-shadow: var(--shadow-sm);
  line-height: 1;
}
.date-badge__m { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #1E5FD8; }
.date-badge__d { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-top: 3px; }

/* ---------- Meta lists ---------- */
.meta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 0.93rem; color: var(--ink-2); }
.meta-list li { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.meta-list .i { color: var(--accent); margin-top: 0.22em; }
:root[data-theme="dark"] .meta-list .i { color: var(--sky); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .meta-list .i { color: var(--sky); } }
.meta-list--inline { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.dl-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 20px; font-size: 0.95rem; }
.dl-grid dt { color: var(--ink-3); font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 0.25em; }
.dl-grid dd { color: var(--ink); font-weight: 550; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Toolbar, search field, filters ---------- */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.toolbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.toolbar__label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.search-field { position: relative; flex: 1 1 280px; max-width: 480px; }
.search-field .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.97rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-field input::placeholder { color: var(--ink-3); }
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.result-count { font-size: var(--fs-sm); color: var(--ink-3); font-family: var(--font-mono); }
.filter-select {
  height: 42px;
  padding: 0 36px 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362739A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
  -webkit-appearance: none;
  appearance: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
}

/* Filter animation */
.is-filtering > * { animation: fadeUp 380ms var(--ease) both; }
.is-filtering > *:nth-child(2) { animation-delay: 40ms; }
.is-filtering > *:nth-child(3) { animation-delay: 80ms; }
.is-filtering > *:nth-child(4) { animation-delay: 120ms; }
.is-filtering > *:nth-child(5) { animation-delay: 160ms; }
.is-filtering > *:nth-child(n+6) { animation-delay: 200ms; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Empty state ---------- */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: clamp(36px, 6vw, 64px) 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  background: var(--grid-bg), var(--surface);
}
.empty-state h3 { font-size: 1.3rem; }
.empty-state p { color: var(--ink-2); max-width: 52ch; }
.empty-state .icon-tile { width: 60px; height: 60px; border-radius: 18px; }
.empty-state .cluster { justify-content: center; margin-top: 6px; }

/* ---------- Stats / counters ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.stat__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat__label { font-weight: 650; color: var(--ink); }
.stat__note { font-size: var(--fs-xs); color: var(--ink-3); }
.stat--pending .stat__value { font-size: 1rem; line-height: 1.4; }
.stat--verified { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.stat--verified .stat__value { color: var(--accent); }
:root[data-theme="dark"] .stat--verified .stat__value { color: var(--sky); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat--verified .stat__value { color: var(--sky); } }

/* ---------- Accordion (FAQ) ---------- */
.accordion { display: grid; gap: 10px; }
.acc-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.acc-item[open] { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.acc-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
}
.acc-item > summary::-webkit-details-marker { display: none; }
.acc-item > summary:hover { color: var(--accent); }
.acc-icon {
  flex: none;
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
}
.acc-icon::before, .acc-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform var(--dur) var(--ease);
}
.acc-icon::after { transform: rotate(90deg); }
.acc-item[open] .acc-icon::after { transform: rotate(0deg); }
.acc-body { padding: 0 20px 20px; color: var(--ink-2); }
.acc-body > * + * { margin-top: 0.8em; }
.acc-item[open] .acc-body { animation: fadeUp 300ms var(--ease); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab .chip__count { background: var(--surface-2); }

/* ---------- Notices ---------- */
.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
}
.notice > .i { color: var(--accent); margin-top: 0.15em; width: 1.3em; height: 1.3em; }
.notice strong { display: block; margin-bottom: 2px; }
.notice p { color: var(--ink-2); }
.notice--warn { background: var(--warn-soft); }
.notice--warn > .i { color: var(--warn); }
.notice--success { background: var(--ok-soft); }
.notice--success > .i { color: var(--ok); }
.notice--danger { background: var(--danger-soft); }
.notice--danger > .i { color: var(--danger); }
.notice--dashed { background: var(--ph-bg); border: 1px dashed var(--ph-line); }
.notice--dashed > .i { color: var(--ph-ink); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 22px; }
.form-section {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  min-width: 0;
}
.form-section + .form-section { padding-top: 26px; border-top: 1px solid var(--line); }
.form-section > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section > legend .step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 640px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__label { font-weight: 650; font-size: 0.95rem; color: var(--ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.field__label .req { color: var(--danger); font-weight: 700; }
.field__label .opt { font-weight: 500; font-size: 0.8rem; color: var(--ink-3); }
.field__hint { font-size: 0.84rem; color: var(--ink-3); line-height: 1.45; }
.field__error { display: none; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--danger); }
.field.is-invalid .field__error { display: flex; }
.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362739A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 18px no-repeat;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--accent); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea { border-color: var(--danger); }
.field.is-valid .input { border-color: var(--ok); }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group__prefix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.input-group .input { border-radius: 0 12px 12px 0; }
.char-count { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-3); text-align: right; }

.field--whatsapp {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--ok-soft), var(--sky-soft));
  border: 1px solid transparent;
}
.field--whatsapp .field__label .wa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--ok);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
:root[data-theme="dark"] .field--whatsapp .field__label .wa-badge { color: #06112B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field--whatsapp .field__label .wa-badge { color: #06112B; } }
.field--whatsapp .input-group__prefix { background: var(--surface); }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.95rem;
  color: var(--ink-2);
  cursor: pointer;
}
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: all var(--dur) var(--ease);
}
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.form-card {
  padding: clamp(22px, 4vw, 40px);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; }
.form-actions p { font-size: var(--fs-xs); color: var(--ink-3); max-width: 46ch; }
.form-errors { display: none; }
.form-errors.is-visible { display: flex; }

.confirm-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 40px);
}
.confirm-panel__icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  animation: pop 500ms var(--ease) both;
}
.confirm-panel__icon--preview { background: var(--ph-bg); color: var(--ph-ink); border: 2px dashed var(--ph-line); }
.confirm-panel__icon .i { width: 40px; height: 40px; stroke-width: 2.4; }
.confirm-panel h2 { font-size: var(--fs-xl); }
.confirm-panel p { color: var(--ink-2); max-width: 54ch; }
.confirm-summary {
  width: 100%;
  max-width: 520px;
  text-align: left;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- Avatars ---------- */
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), var(--sky-soft));
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  flex: none;
  border: 2px solid var(--surface);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.2rem; }

/* ---------- Quote card ---------- */
.quote-card { display: flex; flex-direction: column; gap: 16px; padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.quote-card blockquote { font-size: 1.08rem; line-height: 1.6; color: var(--ink); }
.quote-card blockquote::before {
  content: "\201C";
  display: block;
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 0.6;
  height: 0.45em;
  color: var(--sky);
}
.quote-card figcaption { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--ink-2); }
.quote-card figcaption strong { color: var(--ink); display: block; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(36px, 6vw, 72px);
  background: var(--band-bg);
  color: var(--band-ink);
  isolation: isolate;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(50% 70% at 100% 0%, rgba(56, 182, 242, 0.45), transparent 70%),
    radial-gradient(40% 60% at 0% 100%, rgba(30, 95, 216, 0.5), transparent 70%),
    linear-gradient(var(--band-line) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, var(--band-line) 1px, transparent 1px) 0 0 / 36px 36px;
}
.cta-band canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.8; }
.cta-band__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 48px; align-items: center; }
.cta-band h2 { color: #FFFFFF; font-size: var(--fs-2xl); max-width: 20ch; }
.cta-band p { color: var(--band-ink-2); font-size: var(--fs-md); max-width: 56ch; margin-top: 14px; }
.cta-band .eyebrow { color: var(--sky-300); margin-bottom: 14px; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 820px) { .cta-band__inner { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Toast ---------- */
.toast-region { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-inverse);
  color: var(--ink-inverse);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.92rem;
  animation: toastIn 280ms var(--ease) both;
}
.toast.is-leaving { animation: toastOut 220ms var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Search overlay ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 350; display: flex; justify-content: center; align-items: flex-start; padding: max(8vh, 20px) 16px 16px; }
.search-overlay__backdrop { position: absolute; inset: 0; background: rgba(6, 18, 49, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn 200ms var(--ease); }
.search-overlay__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dropIn 260ms var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-12px) scale(0.98); } }
.search-overlay__bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.search-overlay__bar > .i { color: var(--accent); width: 22px; height: 22px; }
.search-overlay__input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 1.12rem; color: var(--ink); }
.search-overlay__input:focus { outline: none; }
.search-overlay__input::placeholder { color: var(--ink-3); }
.search-overlay__body { overflow-y: auto; padding: 10px; overscroll-behavior: contain; }
.search-overlay__foot { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; padding: 10px 18px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--ink-3); background: var(--surface-2); }
.search-overlay__foot span { display: inline-flex; align-items: center; gap: 6px; }
.sr-group + .sr-group { margin-top: 8px; }
.sr-group__title { padding: 8px 12px 6px; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.sr-list { list-style: none; margin: 0; padding: 0; }
.sr-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--ink);
  text-decoration: none;
}
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--accent-soft); text-decoration: none; }
.sr-item__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); color: var(--accent); flex: none; }
.sr-item[aria-selected="true"] .sr-item__icon { background: var(--surface); }
.sr-item__text { min-width: 0; flex: 1; }
.sr-item__title { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item__sub { display: block; font-size: 0.84rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item__go { color: var(--ink-3); opacity: 0; transition: opacity var(--dur) var(--ease); }
.sr-item[aria-selected="true"] .sr-item__go { opacity: 1; }
.sr-item mark, .result-card mark { background: var(--sky-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.sr-empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.sr-suggest { padding: 8px 8px 12px; }
.sr-suggest .chip-group { padding: 0 4px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 380; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(4, 10, 28, 0.94); color: #EAF3FF; animation: fadeIn 200ms var(--ease); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.lightbox__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.lightbox__count { font-family: var(--font-mono); font-size: 0.8rem; color: #B3C6EA; }
.lightbox__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); animation: fadeIn 260ms var(--ease); }
.lightbox__btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #FFFFFF; transition: background-color var(--dur) var(--ease); }
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox__btn .i { width: 22px; height: 22px; }
.lightbox__prev, .lightbox__next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 10px; }
.lightbox__next { right: 10px; }
.lightbox__caption { padding: 16px 20px 22px; max-width: 820px; margin-inline: auto; width: 100%; display: grid; gap: 6px; text-align: center; }
.lightbox__caption h2 { color: #FFFFFF; font-size: 1.15rem; }
.lightbox__caption p { color: #B3C6EA; font-size: 0.93rem; }
.lightbox__caption .meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 0.85rem; color: #B3C6EA; }
.lightbox__caption a { color: #7FD0F8; font-weight: 700; }
@media (max-width: 640px) {
  .lightbox__stage { padding: 0 12px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: -58px; transform: none; }
  .lightbox__prev { left: calc(50% - 60px); }
  .lightbox__next { right: calc(50% - 60px); }
  .lightbox__caption { padding-top: 70px; }
}

/* ---------- Share row ---------- */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Chip groups rendered as segmented tabs ---------- */
.tabs .chip { border: 0; background: transparent; padding: 9px 16px; color: var(--ink-2); }
.tabs .chip:hover { color: var(--ink); }
.tabs .chip[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs .chip[aria-pressed="true"] .chip__count { background: var(--accent-soft); color: var(--accent); }

/* ---------- Consent checkbox errors ---------- */
.check-field { display: grid; gap: 6px; }
.check-field.is-invalid .field__error { display: flex; }
.check-field.is-invalid .check { color: var(--ink); }
.check a { position: relative; z-index: 1; }

/* ---------- FAQ groups ---------- */
.faq-group[hidden] { display: none; }
.acc-item[hidden] { display: none; }

/* ---------- Narrow-screen safety ---------- */
.split > *, .form-card, .form > *, .form-row > *, .input-group > * { min-width: 0; }
.input, .select, .textarea { min-width: 0; }
.tag { white-space: normal; }
@media (max-width: 400px) {
  .form-card { padding: 20px 16px; border-radius: var(--radius-lg); }
  .field--whatsapp { padding: 14px 12px; }
  .form-actions .btn { width: 100%; }
}

.search-overlay__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.na { color: var(--ink-3); font-weight: 500; }

/* Notice shown above a form that isn't connected to a service yet */
.form-notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 22px; border-radius: var(--radius-md, 14px); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; line-height: 1.55; }
.form-notice .i { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.form-notice p { margin: 0; }
