/* =========================================================================
   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; }


/* ---- Unified page stage: header + content + footer follow the same 780 lines
   as the homepage (contained, airy, no full-width sticky bar) ---- */
.site-stage { min-height: 100vh; display: flex; flex-direction: column;
  max-width: 780px; margin: 0 auto; padding: 22px 22px 26px; }
.site-stage > main { flex: 1 0 auto; display: flex; flex-direction: column; }
.site-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 40px; margin-bottom: 2px; }
/* content shells inside the stage don't re-add width / side padding (the stage owns those) */
.site-stage .page-shell { max-width: none; padding-left: 0; padding-right: 0; }
.app-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.app-brand .brand-mark { width: 26px; height: 26px; border-radius: 8px; }
.app-brand .brand-mark::after { display: none; }
.app-top-actions { display: flex; align-items: center; gap: 16px; }
.app-top-actions form { display: inline; margin: 0; }
.app-toplink { background: none; border: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-dim); transition: color .15s; padding: 0; }
.app-toplink:hover { color: var(--accent); }
/* sun/moon theme toggle (used in the minimal top bar and the app top bar) */
.min-theme { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-dim); cursor: pointer; transition: all .15s var(--ease); }
.min-theme:hover { color: var(--text); border-color: var(--border-strong); }
.min-theme .theme-moon, .drawer-theme .theme-moon { display: none; }
.min-theme .theme-sun, .drawer-theme .theme-sun { display: inline-block; }
[data-theme="light"] .min-theme .theme-sun, [data-theme="light"] .drawer-theme .theme-sun { display: none; }
[data-theme="light"] .min-theme .theme-moon, [data-theme="light"] .drawer-theme .theme-moon { display: inline-block; }
@media (max-width: 540px) {
  .app-top-actions { gap: 12px; }
}
@media (max-width: 480px) {
  .site-stage { padding: 16px 16px 22px; }
}

/* ---- Vertical centering for short base.html pages ---- */
/* opt-in: pages with little content center it in the available height */
.auth-center { flex: 1 0 auto; width: 100%; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin: 0 auto 18px; }
.auth-ic[data-tone="good"] { color: var(--good); }
.auth-ic[data-tone="warn"] { color: #e5484d; }
.auth-card h1 { font-size: clamp(21px, 4.2vw, 26px); margin-bottom: 10px; }
.auth-card .body { color: var(--text-dim); margin-bottom: 4px; }
.auth-form { text-align: left; margin-top: 22px; }
.auth-note { margin-top: 14px; color: var(--text-faint); }

/* ---- Responses table: data as a clean vertical list per row ---- */
.resp-data { display: flex; flex-direction: column; gap: 3px; min-width: 180px; }
.resp-item { font-size: 13.5px; line-height: 1.4; }
.resp-k { color: var(--text-faint); }

/* ---- About page ---- */
.about-shell { padding-top: 72px; }
.about-shell .mr-kicker { margin-bottom: 0; }
/* softer, gentler headline (lighter weight, looser tracking, more breathing room) */
.about-h1 { font-size: clamp(25px, 2.9vw, 34px); font-weight: 600; letter-spacing: -.008em;
  line-height: 1.22; color: var(--text); }
.about-shell .body-lg { max-width: 52ch; margin-left: auto; margin-right: auto; }
.about-points { display: flex; flex-direction: column; gap: 18px; margin: 42px 0 38px; text-align: left; }
.about-point { display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 26px; }
.about-point .uc-ic { flex: none; }
.about-point h3 { margin: 0 0 6px; }
.about-point p { margin: 0; color: var(--text-dim); line-height: 1.6; }

/* ---- 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; }

/* ---- 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; }

/* ---- Generic app-page shell (non-landing pages) ---- */
.page-shell { max-width: 780px; margin: 0 auto; padding: 30px 24px 80px; }
.page-shell-wide { max-width: 780px; }
.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); }


/* 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) ---- */
/* display:none (not width:0) so the sprite <svg> leaves the render tree entirely:
   some mobile GPUs gave the 0x0-but-still-rendered sprite its own compositing
   tile and painted uninitialized memory into it ("static" artifact). <use> can
   still reference the <symbol>s from a display:none svg in all modern browsers. */
.icon-sprite { display: none; }

/* ---- 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) {
  /* tighten brand mark on small screens */
  .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; }

/* ---- v2: gallery + landing helpers ---- */
.create-shell-wide { max-width: 960px; }

/* slim, centred slug composer in the "Γιατί Apantia" section */
.composer-slim { max-width: 560px; margin: 8px auto 42px; padding: 0px 0px 0px 18px; gap: 10px; }
.composer-slim .btn { padding: 9px 16px; }
/* tighten the gap from the hero to the first section below */
.hero { padding-bottom: clamp(28px, 4vw, 44px); }
.section-pull-top { padding-top: clamp(22px, 3vw, 40px); }
/* straight, modern preview (override the v1 tilt) */
.hero .browser { transform: none; }

/* --- mobile overflow hardening --- */
/* flex items with long unbreakable text must be allowed to shrink (default
   min-width:auto forces them wider than the viewport on small screens). */
.browser-url { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer { max-width: 100%; }
.composer .url { min-width: 0; overflow: hidden; }
.composer .url b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* keep the composer prefix + slug together on one line, even when stacked */
.composer-url-row { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
.composer-url-row .url { flex: 1; }
/* (mobile nav + hero responsive rules now live in mobile.css) */
.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; }
