/* ============================
   TrendFit Shared Styles (Option A)
   - Lightweight, no frameworks
   - Mobile-first, responsive
   ============================ */

:root {
  color-scheme: light;
  --brand1: #FF8C00; /* orange */
  --brand2: #FF4500; /* orange-red */
  --accent: #0d6efd; /* action blue */
  --ink: CanvasText;
  --bg: Canvas;
  --card: #ffffff;
  --muted: rgba(0,0,0,.6);
  --border: rgba(0,0,0,.12);
  --shadow: rgba(0,0,0,.08);

  /* Sticky header height used in the min-height calc */
  --header-h: 56px;

  /* Home hero logo target height for panel pairing */
  --hero-logo-h: 160px; /* try 140–180px to taste */
}

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }

/* Background gradient option (used on features, signup, etc.) */
.bg-gradient::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  opacity: .13;
  pointer-events: none;
}

/* NEW: Diagonal line overlay (used on home & signup) */
.bg-diagonal-line::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="100%" x2="100%" y2="0" stroke="white" stroke-opacity="0.05" stroke-width="10" /></svg>');
  background-repeat: repeat;
  z-index: -1;
  pointer-events: none;
}

/* NEW: Home page background gradient (moved from inline) */
body.home {
  background: linear-gradient(135deg, #2dbaf7, #0a5db3);
}

/* Layout helpers */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section.alt { background: rgba(255,255,255,.55); }
.section.highlight { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { margin: 0 0 20px; font-size: clamp(24px, 3vw, 32px); }

/* Header / Nav */
.site-header {
  position: sticky; top: 0;
  /* Fallback for older engines */
  background: rgba(255,255,255,.85);
  /* Modern polish */
  backdrop-filter: saturate(180%) blur(8px);
  background: color-mix(in oklab, white 75%, transparent);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; }
.brand img { display: block; }
.nav-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: inherit; text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(0,0,0,.06); }

/* Nav: panel-style pills (unified across pages) */
.site-header .nav-links a {
  background: #FFF3E3;
  border: 1px solid #FFC888;
  border-radius: 12px;
  padding: 8px 12px;
  line-height: 1.2;
}
.site-header .nav-links a:hover,
.site-header .nav-links a:focus-visible {
  background: #FFEAD1;
  border-color: #FFCF8F;
}
.site-header .nav-links a[aria-current="page"] {
  background: #FFEAD1;
  border-color: #FFB85E;
}
/* Normalize legacy btn classes if present in header links */
.site-header .nav-links a.btn,
.site-header .nav-links a.btn-compact {
  background: #FFF3E3 !important;
  color: inherit !important;
  border: 1px solid #FFC888 !important;
  border-radius: 12px !important;
  padding: 8px 12px !important;
  box-shadow: none !important;
}

/* --- Navbar: let pills wrap; avoid overflow/clipping --- */
.site-header .nav {
  height: auto;              /* override fixed height */
  min-height: 56px;
  padding-block: 8px;        /* space top/bottom */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;           /* allow multiple rows */
  gap: 12px;
}
.site-header .brand { flex: 0 0 auto; }
.site-header .nav-links {
  flex: 1 1 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
@media (max-width: 840px) {
  .site-header .nav { padding-block: 6px; }
  .site-header .nav-links a { padding: 6px 10px; font-size: 14px; }
}
@media (max-width: 520px) {
  .site-header .nav-links { gap: 6px; }
  .site-header .nav-links a { padding: 5px 8px; font-size: 13px; }
}
@media (max-width: 1180px) {
  .site-header .nav {
    flex-wrap: wrap;
    height: auto;
    padding-block: 8px;
    row-gap: 8px;
  }
  .site-header .nav .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
    margin-top: 6px;
  }
}

/* ===== Announcements "new" badge on navbar ===== */
.site-header .nav-links a.has-badge { position: relative; }

.site-header .nav-links a .nav-badge {
  position: absolute;
  top: -3px;                 /* snug at top-right corner */
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e11900;       /* red dot */
  border: 2px solid #fff;    /* ring for contrast on light pills */
  box-shadow: 0 0 0 1px rgba(0,0,0,.06); /* subtle lift */
}

/* Hero */
.hero { padding: 56px 0 32px; text-align: center; }
.hero-title { margin: 0 0 8px; font-size: clamp(28px, 6vw, 44px); }
.hero-subtitle { margin: 0 auto; max-width: 820px; color: var(--muted); font-size: clamp(16px, 2.5vw, 18px); }
.hero-actions { margin-top: 18px; display: inline-flex; gap: 12px; flex-wrap: wrap; }
.accent { color: var(--brand2); }

/* Grid */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 30px var(--shadow);
}
.card h3 { margin-top: 8px; margin-bottom: 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }
.card-icon { font-size: 22px; color: var(--brand2); }

/* Gallery */
.gallery .shot { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 6px 20px var(--shadow); }
.gallery img { width: 100%; height: auto; display: block; }
.gallery figcaption { padding: 10px 12px; font-size: 14px; color: var(--muted); }

/* Steps */
.steps { margin: 0; padding-left: 1.25rem; }
.steps li { margin: 8px 0; }

/* FAQ */
.faq { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.faq > summary { cursor: pointer; font-weight: 600; }
.faq > p { margin: 8px 0 0; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid transparent;
  text-decoration: none; font-weight: 600; cursor: pointer;
}
.btn-compact { padding: 8px 10px; font-size: 14px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { filter: brightness(0.92); }
.btn-ghost { background: transparent; color: inherit; border-color: var(--border); }
.btn-ghost:hover { background: rgba(0,0,0,.06); }

/* Socials */
.socials {
  margin-top: 25px;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.social-links a {
  text-decoration: none;
  color: #007bff;
  font-size: 24px; /* icons a bit larger without labels */
}

/* Footer */
.site-footer {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  /* Fallback */
  background: rgba(255,255,255,.85);
  /* Modern */
  background: color-mix(in oklab, white 85%, transparent);
}
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-links { display: inline-flex; gap: 8px; }

/* Accessibility niceties */
a:focus-visible, button:focus-visible { outline: 3px solid color-mix(in oklab, var(--accent) 40%, transparent); outline-offset: 2px; }

/* ==============================================
   Page: Landing (welcome)
   - Vertical centering shell
   - Signup iframe sizing
   ============================================== */

.page-wrap {
  min-height: calc(100dvh - var(--header-h)); /* fill viewport under sticky header */
  width: 100%;
  display: grid;
  place-items: center; /* centers both axes */
}
.page-wrap > .container { margin: 24px; }

@media (max-width: 900px) {
  .page-wrap {
    min-height: auto;
    place-items: stretch;
  }
  .page-wrap > .container { margin: 16px; }
}

/* Signup iframe sizing – adapts to viewport height */
#signupFrame {
  width: 100%;
  height: clamp(640px, 70vh, 1100px);
  border: 0;
  display: block;
}
@media (max-width: 900px) {
  #signupFrame { height: 560px; }
}

/* Home: show colored framing around portrait preview */
body.home .video-wrap { 
  padding-block: 18px;
}

/* Make SVG logos scale crisply */
.brand img { height: 28px; width: auto; display: block; }

/* Visually hidden but accessible */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ================================
   Home — centered, panel layout
   ================================ */

/* Card: 1100 wide, 38px inner padding, 38px gap */
body.home .page-wrap > .container {
  display: flex;
  gap: 38px;
  padding: 38px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-radius: 12px;
}

/* Columns: ~493px rails */
body.home .left-content  { flex: 0 1 493px; display: flex; justify-content: flex-start; }
body.home .right-content { flex: 1 1 493px; padding: 0 !important; }

/* The 445px content column centered within the left rail */
body.home .left-content .stack {
  width: 100%;
  max-width: 445px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  text-align: center;
}

/* Logo sizing (180×auto slot) */
body.home .left-content .logo { width: 180px; height: auto; margin: 6px auto 10px; }

/* Tinted panels (warm complement to blue background) */
.panel {
  background: #FFF3E3;
  border: 1px solid #FFC888;
  border-radius: 12px;
  padding: 18px 20px;
}
.panel-hero { padding: 22px 20px; }
.panel + .panel { margin-top: 18px; }

/* Hero heading */
.panel-hero .hero-title {
  margin: 4px 0;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: clamp(32px, 5vw, 44px);
}

/* Copy rhythm */
.panel-text p { margin: 8px 0; }

/* Video container */
body.home .video-wrap {
  background: var(--brand1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 14px;
  border-radius: 12px;
}
body.home .video-wrap .preview {
  width: auto;
  max-width: 100%;
  height: clamp(620px, 72vh, 740px);
  aspect-ratio: 9 / 16;
  object-fit: contain;
  display: block;
}

/* Mobile stacking */
@media (max-width: 900px) {
  body.home .page-wrap > .container { flex-direction: column; gap: 18px; padding: 16px; }
  body.home .left-content, body.home .right-content { flex: 1 1 auto; }
}

/* === Home: keep centering/locking on mobile like Signup === */
body.home .page-wrap {
  /* Re-assert full-viewport height under the sticky header */
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  place-items: center;
}

/* Optional: use small-viewport units on iOS Safari for better address-bar behavior */
@supports (height: 100svh) {
  body.home .page-wrap {
    min-height: calc(100svh - var(--header-h));
  }
}

/* === Home: reduce preview min height on narrow screens to avoid forced scroll === */
@media (max-width: 900px) {
  body.home .video-wrap .preview {
    /* lower min; keep a flexible vh target so the card fits within the viewport */
    height: clamp(420px, 70vh, 740px);
  }

  /* Keep Home centered on mobile even though the global .page-wrap relaxes */
  body.home .page-wrap {
    min-height: calc(100svh - var(--header-h));
    place-items: center;
  }
}

/* =========================================
   Home: put “Coming Soon!” panel beside logo
   ========================================= */
body.home .logo-hero-row {
  display: flex;
  align-items: stretch;
  gap: 48px;
  margin-bottom: 18px;
}
body.home .logo-hero-row .logo {
  height: var(--hero-logo-h);
  width: auto;
  margin: 0;
  display: block;
}
body.home .logo-hero-row .panel-hero {
  display: grid;
  place-items: center;
  min-height: var(--hero-logo-h);
  text-align: center;
}
body.home .logo-hero-row .panel-hero .hero-title {
  margin: 0;
  line-height: 0.95;
  font-size: clamp(28px, 3.8vw, 40px);
}
body.home .logo-hero-row .panel-hero .hero-title .break {
  display: block;
}
@media (max-width: 700px) {
  body.home .logo-hero-row { flex-direction: column; align-items: center; }
}

/* Panel-text: bullet styling */
.panel.panel-text { text-align: left; }
.panel-text .panel-kicker {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 20px);
}
.panel-text .feature-bullets {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: grid;
  gap: 10px;
}
.panel-text .feature-bullets li {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  column-gap: 10px;
}
.panel-text .feature-bullets i {
  line-height: 1;
  margin-top: 2px;
  color: var(--brand2);
  font-size: 16px;
}
.panel-text .feature-bullets span {
  display: block;
  font-size: 16px;
  line-height: 1.5;
}

/* CTAs — two-column layout: label (left) | fixed-width button (right) */
.panel-cta .cta-list { display: flex; flex-direction: column; }
.panel-cta .cta-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.panel-cta .cta-row + .cta-row {
  border-top: 1px dashed color-mix(in oklab, var(--accent) 30%, transparent);
  margin-top: 8px;
}
.panel-cta .cta-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
}
.panel-cta .cta-label .cta-icon {
  color: var(--brand2);
  font-size: 16px;
  line-height: 1;
}
.panel-cta a.btn {
  justify-self: end;
  width: 120px;
  white-space: nowrap;
  background: var(--accent) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.panel-cta a.btn:hover { filter: brightness(0.92); }

/* Center the app preview vertically in the right column (desktop only) */
@media (min-width: 901px) {
  body.home .right-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 !important;
  }
  body.home .right-content .video-wrap {
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 900px) {
  body.home .right-content { display: block; }
}

/* Members Forum (beta-feedback.html presented as "Members Forum") */
.forum .forum-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;         /* stack on mobile */
}

@media (min-width: 700px) {
  .forum .forum-grid {
    grid-template-columns: 1.6fr 1fr; /* give ideas card a bit more room */
  }
}

/* Suggestions form iframe sizing */
.forum .suggestions-embed {
  width: 100%;
  height: clamp(640px, 70vh, 1200px);
  border: 0;
  display: block;
}

/* Center headers in Members Forum cards */
.forum-grid .card h3 {
  text-align: center;
}

/* Guarantee the TestFlight button is centered */
.forum-grid .card .btn {
  display: block;              /* block + auto margins centers reliably */
  width: max-content;          /* shrink-wrap to content */
  margin: 12px auto;           /* center horizontally */
}

/* ================================
   Page: Sign Up (scoped layout)
   ================================ */
/* Signup page background (align with Home approach) */
body.signup {
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
}

   body.signup .page-wrap {
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  place-items: center;
}
body.signup .page-wrap > .container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,.10);
  width: 100%;
  max-width: 1100px;
  margin: 24px;
  overflow: hidden;

  /* Use grid for reliable split in Safari */
  display: grid;
  grid-template-columns: 640px 1fr;
  gap: 0;
  padding: 0;
}
body.signup .left-content  { padding: 40px; text-align: center; }
body.signup .right-content {
  padding: 0;
  display: grid;
  align-content: center;
  min-width: 0;
}
body.signup #signupFrame {
  width: 100%;
  height: clamp(480px, 76vh, 1100px);
  border: 0;
  display: block;
}
@media (max-width: 900px) {
  body.signup .page-wrap > .container {
    grid-template-columns: 1fr;
    margin: 16px;
  }
  body.signup .left-content  { padding: 20px; }
  body.signup #signupFrame   { height: 560px; }
}

/* Sign Up: benefits alignment */
body.signup .signup-benefits { text-align: left; margin-top: 20px; }
body.signup .signup-benefits p { margin: 8px 0; }

/* Restore logo size for signup page */
body.signup .left-content .logo {
  width: 180px;
  height: auto;
  margin-bottom: 0;
}

/* Prefers-reduced-motion: tone down animated/auto-playing media where applicable */
@media (prefers-reduced-motion: reduce) {
  video[autoplay] { animation: none !important; }
}
