/* =========================================================================
   app.css - app-specific layer ON TOP of Apantia's styles.css + layout.css.
   Reuses Apantia tokens (var(--surface), var(--accent)…) so everything stays
   cohesive. No CSS lives in templates.
   ========================================================================= */

/* ---- Icon sprite (referenced via <svg class="ic"><use href="#i-…"></use></svg>) ---- */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.ic-13 { width: 13px; height: 13px; }
.ic-15 { width: 15px; height: 15px; }
.ic-16 { width: 16px; height: 16px; }
.ic-18 { width: 18px; height: 18px; }
.ic-26 { width: 26px; height: 26px; }
.ic-30 { width: 30px; height: 30px; }

/* ---- Theme switcher: 3 dot-buttons ---- */
.theme-switcher { display: flex; align-items: center; gap: 3px; }
.theme-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: none; border: none; padding: 6px 5px; cursor: pointer;
  border-radius: var(--radius-sm); transition: opacity .15s;
}
.theme-btn:hover { opacity: .75; }
.theme-dot {
  width: 13px; height: 13px; border-radius: 50%;
  transition: box-shadow .18s;
}
.theme-btn[data-active="true"] .theme-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.td-dark  { background: #1a1714; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.td-blue  { background: #192b44; box-shadow: inset 0 0 0 1px rgba(120,160,255,.30); }
.td-light { background: #f0ece5; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.theme-btn[data-active="true"] .td-dark  { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent), inset 0 0 0 1px rgba(255,255,255,.15); }
.theme-btn[data-active="true"] .td-blue  { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent), inset 0 0 0 1px rgba(120,160,255,.30); }
.theme-btn[data-active="true"] .td-light { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent), inset 0 0 0 1px rgba(0,0,0,.12); }
.theme-lbl { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); line-height: 1; }

/* ---- Honeypot ---- */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- Flash messages ---- */
.msg-wrap { padding: 16px 0 0; }
.message { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text);
  border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 10px; }

/* ---- Decorative bits used by the hero browser mock ---- */
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.av-1 { background: #ea580c; }
.av-2 { background: #0d9488; }
.av-3 { background: #6366f1; }
.av-4 { background: #e11d48; }
.av-more { background: var(--surface-3); color: var(--text-dim); }

/* ---- Landing section spacing tweaks ---- */
.section-tight { padding-top: 0; }
.cta-h { max-width: 18ch; margin: 0 auto 14px; }
.cta-p { max-width: 44ch; margin: 0 auto 26px; }

/* ---- Use-case status badge (live / coming soon) ---- */
.uc-status { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: var(--radius-pill); }
.uc-status.live { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.uc-status.soon { background: var(--surface-3); color: var(--text-faint); }
.uc-card.soon { opacity: 0.72; cursor: default; }
.uc-card.soon:hover { transform: none; border-color: var(--border); box-shadow: none; }

/* ---- Generic app-page shell (non-landing pages) ---- */
.page-shell { max-width: 760px; margin: 0 auto; padding: 30px 24px 80px; }
.page-head { margin-bottom: 22px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---- Dashboard list ---- */
.list { display: grid; gap: 12px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.list-row .meta { color: var(--text-faint); font-size: 13px; margin-top: 4px; }

/* ---- Simple responses table ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 14px; vertical-align: top; }
.tbl th { color: var(--text-faint); font-weight: 650; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- RSVP choice rendered as native radios (no JS, accessible) ---- */
.rsvp-choice { cursor: pointer; position: relative; }
.rsvp-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rsvp-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---- Poll choices: vertical radio list ---- */
.poll-choices { display: grid; gap: 9px; }
.poll-choice {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface-2); font-weight: 650; font-size: 15px;
  color: var(--text-dim); transition: all .15s var(--ease); cursor: pointer; position: relative;
}
.poll-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.poll-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.poll-choice::before {
  content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-strong); transition: all .15s var(--ease);
}
.poll-choice:has(input:checked)::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }

/* danger button on top of Apantia buttons */
.btn-danger { background: #c0392b; color: #fff; border-color: transparent; }
.btn-danger:hover { background: #a93226; }

/* ---- Icon sprite container (hidden) ---- */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- Card actions row (manage page) ---- */
.card-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* =====================================================================
   Mobile responsive
   ===================================================================== */

@media (max-width: 640px) {
  /* Nav: hide secondary links, tighten spacing */
  .nav-hide-sm { display: none !important; }
  .nav-actions { gap: 7px; }
  .nav-actions .btn { padding: 8px 11px; font-size: 13px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 26px; height: 26px; }

  /* Shells: reduce horizontal padding */
  .page-shell { padding: 20px 16px 60px; }
  .create-shell { padding: 20px 16px 60px; }

  /* Cards */
  .card-pad { padding: 18px; }

  /* Manage: link box stacks vertically */
  .link-box { flex-direction: column; align-items: stretch; }
  .link-box .btn { justify-content: center; }
  .link-box .kbd-link { font-size: 12px; word-break: break-all; }

  /* Manage: action buttons stack */
  .card-actions { flex-direction: column; align-items: stretch; }
  .card-actions .btn { justify-content: center; }

  /* Response table: horizontal scroll */
  .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-scroll .tbl { min-width: 480px; }
}

@media (max-width: 480px) {
  /* Create flow header: stack icon+title above demo button */
  .create-head { flex-direction: column; align-items: flex-start; }

  /* Public page: tighter */
  .pub-shell { padding: 14px 10px 50px; }
  .pub-banner { height: 110px; margin-bottom: -28px; }
  .pub-card { padding: 18px 16px; }

  /* Stepper: hide text labels, keep circles */
  .stepper-item span:not(.num) { display: none; }
}

/* ---- Forms (manual field rendering) ---- */
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: #e5484d; font-size: 13px; }
.error { color: #e5484d; font-size: 14px; margin-bottom: 8px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text-dim); cursor: pointer; }
.consent input { width: auto; margin: 2px 0 0; }

/* ---- Create flow header + app cards ---- */
.create-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 22px; }
.create-head-l { display: flex; align-items: center; gap: 14px; }

/* ---- Listing public page ---- */
.chips-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.listing-desc { line-height: 1.6; margin-top: 16px; }
.label-lg { font-size: 16px; font-weight: 700; }

/* ---- v2: gallery + landing helpers ---- */
.create-shell-wide { max-width: 820px; }
.sec-center { text-align: center; margin-left: auto; margin-right: auto; }
.gal-card-soon { opacity: 0.72; cursor: default; }
.gal-card-soon:hover { transform: none; border-color: var(--border); box-shadow: none; }
.pop-badge.soon-badge { color: var(--text-faint); background: var(--surface-3); border-color: var(--border); }
.card-pad { padding: 26px; }
.card-pad > .label { display: block; margin-bottom: 10px; }
.page-shell .card { margin-bottom: 16px; }
