/* Tunda Island Stores — business portal skin.
 *
 * Layered AFTER styles.css, which stays the source of truth for the palette
 * tokens, the .cta pill and the base .card/.metric/.panel geometry. Nothing
 * here redefines a token globally: index.html is the only page that loads this
 * file, but styles.css is shared with app.js's expectations, so this sheet
 * only ever adds or overrides within .portal-body.
 *
 * Carries the showcase's language into the logged-in product — depth field,
 * eyebrows, the type scale, photography — so a venue that arrives from
 * showcase.html does not feel handed off to a different, older tool.
 *
 * HARD CONSTRAINT: app.js addresses this DOM by ID (48 of them) and toggles
 * the `hidden` class. Every id="" and the .hidden rule in styles.css must
 * survive any markup change; this file is styling only.
 */

.portal-body {
  --ink: #16233B;
  --gold: #E8B765;
  --shadow-lift: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
  --shadow-deep: 0 30px 70px -24px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: clamp(18px, 4vw, 40px);

  background: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Depth field (shared with the showcase) ─────────────────────────────── */
.pt-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58vw 46vw at 12% -6%, rgba(199, 212, 238, 0.14), transparent 62%),
    radial-gradient(52vw 44vw at 92% 4%,  rgba(138, 160, 204, 0.10), transparent 66%),
    radial-gradient(60vw 50vw at 80% 98%, rgba(232, 183, 101, 0.06), transparent 68%);
}
.pt-field::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
.portal-body > *:not(.pt-field) { position: relative; z-index: 1; }

/* ── Eyebrow / section headings ─────────────────────────────────────────── */
/* Replaces the bare .section label from styles.css with the showcase's ruled
   eyebrow. Same element, same text — app.js never touches these. */
.portal-body .section {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--peri-dim);
  margin: 40px 0 16px;
}
.portal-body .section::before {
  content: "";
  width: 26px;
  height: 1px;
  flex: none;
  background: linear-gradient(90deg, var(--peri), transparent);
}

/* ── Auth gate ──────────────────────────────────────────────────────────────
   Full-bleed photograph behind the sign-in card, mirroring the showcase hero:
   this is the first screen after "Claim your Spot", so the seam between the
   two pages is exactly here. */
.portal-body .gate {
  position: relative;
  isolation: isolate;
  padding: clamp(28px, 6vw, 64px) var(--gutter);
}
.gate-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.gate-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}
.gate-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(16, 27, 48, 0.62) 0%,
      rgba(16, 27, 48, 0.8) 45%,
      rgba(22, 35, 59, 0.94) 100%),
    linear-gradient(90deg, rgba(22, 35, 59, 0.8), rgba(30, 46, 75, 0.34));
}

/* The gate card floats OVER content, so per the card rule it stays glass —
   this is the one place glass is correct. */
.portal-body .glass-card {
  max-width: 460px;
  padding: 38px 32px 30px;
  border-radius: 26px;
  background: rgba(22, 35, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  box-shadow: var(--shadow-deep);
}
.gate-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--peri-dim);
  margin-bottom: 16px;
}
.gate-eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--peri), transparent);
}
.portal-body .glass-card .wordmark { font-size: 27px; }
.portal-body .tagline {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--peri-dim);
  line-height: 1.6;
  margin: 12px 0 22px;
}
/* Back to the pitch — a venue that lands on the gate by accident should be
   able to read the case for claiming rather than bounce. */
.gate-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--peri-dim);
  text-decoration: none;
}
.gate-back:hover { color: var(--peri); }
.gate-back svg { width: 14px; height: 14px; }

/* ── Top bar ────────────────────────────────────────────────────────────── */
/* Spans the full viewport, not just the .portal column. A negative margin of
   one gutter only reaches the column's edge, which left the glass as a
   floating slab with page visible either side; 50vw-50% breaks it out to the
   true viewport edges regardless of how wide the centred column is. */
.portal-body .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin-inline: calc(50% - 50vw);
  padding: 14px max(var(--gutter), calc(50vw - 450px + var(--gutter)));
  background: rgba(22, 35, 59, 0.72);
  border-bottom: 1px solid var(--hairline-strong);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.portal-body .who { font-weight: 500; }
.portal-body .ghost-btn {
  transition: background 180ms var(--ease), border-color 180ms var(--ease);
}
.portal-body .ghost-btn:hover {
  background: rgba(199, 212, 238, 0.14);
  border-color: rgba(199, 212, 238, 0.42);
}

.portal-body .portal { max-width: 900px; padding-inline: var(--gutter); }

/* ── Claim page header ──────────────────────────────────────────────────── */
/* A venue arriving from the showcase should see the same argument continue,
   not a bare form. */
.pt-claim-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-lift);
  margin-bottom: 18px;
  isolation: isolate;
}
.pt-claim-hero-media { position: absolute; inset: 0; z-index: -1; }
.pt-claim-hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}
.pt-claim-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg,
      rgba(16, 27, 48, 0.95) 0%,
      rgba(16, 27, 48, 0.86) 52%,
      rgba(22, 35, 59, 0.6) 100%);
}
.pt-claim-hero-inner { padding: clamp(24px, 4vw, 38px); }
.pt-claim-hero h1 {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.14;
  margin: 0 0 10px;
}
.pt-claim-hero p {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--peri-dim);
  line-height: 1.62;
  margin: 0;
  max-width: 56ch;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
/* Lifts the flat same-bg card off the darker --ink floor. Geometry (radius,
   padding) still comes from styles.css so the portal and app stay in step. */
.portal-body .card {
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014));
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-lift);
}

/* The amber "how it works" card keeps its guidance colour but gains depth. */
.portal-body .info-card {
  background: linear-gradient(168deg, rgba(232, 183, 101, 0.11), rgba(232, 183, 101, 0.035));
  border-color: rgba(232, 183, 101, 0.3);
}
.portal-body .info-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.portal-body .info-card .steps li { margin-bottom: 6px; }

/* ── Fields ─────────────────────────────────────────────────────────────── */
.portal-body .field-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--peri-dim);
}
.portal-body input,
.portal-body textarea {
  background: rgba(0, 0, 0, 0.16);
  border-color: var(--hairline-strong);
  transition: border-color 160ms var(--ease), background 160ms var(--ease),
              box-shadow 160ms var(--ease);
}
.portal-body input:focus,
.portal-body textarea:focus {
  background: rgba(0, 0, 0, 0.24);
  border-color: var(--peri);
  box-shadow: 0 0 0 3px rgba(199, 212, 238, 0.14);
}

/* ── Primary button ─────────────────────────────────────────────────────── */
.portal-body .cta {
  box-shadow: 0 10px 26px -10px rgba(199, 212, 238, 0.45);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease),
              filter 180ms var(--ease);
}
.portal-body .cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px -12px rgba(199, 212, 238, 0.6);
}
.portal-body .cta:active:not(:disabled) { transform: translateY(0); }

/* ── My Spot header ─────────────────────────────────────────────────────── */
.portal-body .spot-name {
  font-size: 23px;
  letter-spacing: -0.6px;
}
.portal-body .chip {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── Metric tiles ───────────────────────────────────────────────────────────
   The numbers are the reason an owner opens this page, so they get the most
   typographic weight on the screen. */
.portal-body .metric {
  background: rgba(0, 0, 0, 0.18);
  border-color: var(--hairline-strong);
  padding: 15px 10px;
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}
.portal-body .metric:hover {
  border-color: rgba(199, 212, 238, 0.3);
  transform: translateY(-2px);
}
.portal-body .metric-n {
  font-size: 25px;
  letter-spacing: -0.8px;
  line-height: 1.1;
}
.portal-body .metric-l {
  font-size: 8.5px;
  letter-spacing: 1.3px;
  color: var(--peri-dim);
  margin-top: 6px;
}

/* ── Billable / organic / perk panels ───────────────────────────────────────
   These are visually distinct on purpose (monetization_policy.md §2): a venue
   must see at a glance which numbers can appear on an invoice. The tint is the
   trust argument, so it is strengthened here rather than flattened. */
.portal-body .panel {
  background: rgba(0, 0, 0, 0.14);
  border-radius: var(--r-lg);
  padding: 16px 16px 12px;
}
.portal-body .panel-title {
  font-size: 10.5px;
  letter-spacing: 1.5px;
}
.portal-body .panel-billable {
  border-color: rgba(199, 212, 238, 0.3);
  background:
    linear-gradient(168deg, rgba(199, 212, 238, 0.07), transparent 60%),
    rgba(0, 0, 0, 0.14);
}
.portal-body .panel-organic {
  border-color: rgba(76, 175, 80, 0.32);
  background:
    linear-gradient(168deg, rgba(76, 175, 80, 0.08), transparent 60%),
    rgba(0, 0, 0, 0.14);
}
.portal-body .panel-perk {
  border-color: rgba(255, 209, 102, 0.32);
  background:
    linear-gradient(168deg, rgba(255, 209, 102, 0.08), transparent 60%),
    rgba(0, 0, 0, 0.14);
}

/* ── Sub-headings inside the editor ─────────────────────────────────────── */
.portal-body .sub {
  font-size: 16px;
  letter-spacing: -0.2px;
  margin: 30px 0 4px;
  color: #fff;
}
.portal-body .sub::before {
  background: linear-gradient(90deg, rgba(199, 212, 238, 0.4), rgba(255, 255, 255, 0.06));
  box-shadow: none;
  margin-bottom: 16px;
}

/* ── Claim rows (markup generated by app.js — classes are a contract) ────── */
.portal-body .claim-row {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--hairline-strong);
  border-radius: var(--r-lg);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}
.portal-body .claim-row:hover {
  border-color: rgba(199, 212, 238, 0.28);
  transform: translateX(2px);
}
.portal-body .claim-row .name { font-size: 15px; font-weight: 700; }

/* ── Promote: place-search predictions ──────────────────────────────────── */
.portal-body .promote-predictions {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.24);
}
.portal-body .promote-pred {
  text-align: left;
  padding: 11px 13px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 140ms var(--ease);
}
.portal-body .promote-pred:last-child { border-bottom: none; }
.portal-body .promote-pred:hover { background: rgba(199, 212, 238, 0.12); }
.portal-body #promote-radius {
  width: 100%;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  color: #fff;
  font: inherit;
  font-size: 14px;
  padding: 12px 14px;
}
.portal-body #promote-chosen { color: var(--ok); font-weight: 600; }

/* ── Perk QR ────────────────────────────────────────────────────────────── */
.portal-body .perk-qr {
  border-radius: var(--r-lg);
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.6);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.portal-body .foot {
  margin-top: 56px;
  padding-block: 22px 40px;
  font-weight: 500;
}
.portal-body .foot a { text-decoration: none; }
.portal-body .foot a:hover { color: var(--peri); text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .portal-body .glass-card { padding: 30px 22px 24px; }
  .portal-body .topbar { padding-inline: var(--gutter); }
  .portal-body .metric-n { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-body *,
  .portal-body *::before,
  .portal-body *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
