/*
 * Platform landing page (landing.php, multi mode). The platform's own look, independent of any
 * restaurant theme: brand tokens below, Readex Pro. Light and dark follow <html data-theme>, set by
 * partials/theme_boot.php from the visitor's switch or the device setting; without scripts, the device setting.
 * Phone first; no horizontal scroll at 360 px.
 */

:root {
  color-scheme: light;
  /* TurboDiner «Coffee Rush» logo, mint teal accent. */
  --tm-bg: #fbf8f4;
  --tm-surface: #ffffff;
  --tm-surface-2: #f5ece2;
  --tm-text: #2a1d17;
  --tm-muted: #6b5b51;
  --tm-line: #ecdfd2;
  --tm-accent: #0f766e;
  --tm-accent-strong: #115e59;
  --tm-accent-soft: #d5f5ef;
  --tm-accent-ink: #ffffff;
  --tm-band: #2a1d17;
  --tm-band-ink: #f7ebdd;
  --tm-ok: #2f7a45;
  --tm-shadow: 0 1px 2px rgba(42, 29, 23, .06), 0 12px 32px rgba(42, 29, 23, .08);
  --tm-radius: 18px;
  --tm-font: "Readex Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  --tm-display: "DM Serif Display", Georgia, "Times New Roman", serif;
}

/* Dark: the same tokens twice, for the switch and for a device in dark mode when scripts are off. */
html[data-theme="dark"] {
  color-scheme: dark;
  --tm-bg: #0f0f0f;
  --tm-surface: #161616;
  --tm-surface-2: #1b1b1b;
  --tm-text: #ececec;
  --tm-muted: #ababab;
  --tm-line: #2a2a2a;
  --tm-accent: #2dd4bf;
  --tm-accent-strong: #5eead4;
  --tm-accent-soft: rgba(45, 212, 191, .14);
  --tm-accent-ink: #04211d;
  --tm-band: #1b1b1b;
  --tm-ok: #6cc98a;
  --tm-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --tm-bg: #0f0f0f;
    --tm-surface: #161616;
    --tm-surface-2: #1b1b1b;
    --tm-text: #ececec;
    --tm-muted: #ababab;
    --tm-line: #2a2a2a;
    --tm-accent: #2dd4bf;
    --tm-accent-strong: #5eead4;
    --tm-accent-soft: rgba(45, 212, 191, .14);
    --tm-accent-ink: #04211d;
    --tm-band: #1b1b1b;
    --tm-ok: #6cc98a;
    --tm-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html.tm-locked { overflow: hidden; }
body.tm { margin: 0; background: var(--tm-bg); color: var(--tm-text); font-family: var(--tm-font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.tm h1, .tm h2, .tm h3, .tm p { margin: 0; }
:where(.tm) a { color: inherit; }
.tm .ico { width: 1.15em; height: 1.15em; flex: none; }
.tm-wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding-inline: 18px; }

/* Top bar */
.tm-top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--tm-bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--tm-line); }
.tm-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.tm-brand { white-space: nowrap; direction: ltr; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; color: var(--tm-text); }
.tm-mark { width: 36px; height: 36px; color: var(--tm-text); flex: none; }
.tm-wordmark { font-family: var(--tm-display); font-weight: 400; font-size: 1.45rem; letter-spacing: -.005em; }
.tm-tag { font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 3px 7px 2px; border-radius: 6px; background: var(--tm-accent); color: var(--tm-accent-ink); }
.tm-brand-small .tm-wordmark { font-size: 1.2rem; }
.tm-brand-small { font-size: 1rem; }
.tm-brand-small .tm-mark { width: 24px; height: 24px; }
.tm-nav { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.tm-nav a { white-space: nowrap; text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--tm-muted); }
.tm-nav a:hover { color: var(--tm-text); }
.tm-nav .tm-nav-login { color: var(--tm-text); border: 1px solid var(--tm-line); background: var(--tm-surface); }

/* Light/dark switch (assets/js/theme-toggle.js): a moon in light mode, a sun in dark mode. */
.tm-theme { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--tm-line); border-radius: 50%; background: var(--tm-surface); color: var(--tm-text); cursor: pointer; }
.tm-theme:hover { border-color: var(--tm-accent); }
.tm-theme .ico { width: 18px; height: 18px; }
.tm-theme .tm-ico-sun, html[data-theme="dark"] .tm-theme .tm-ico-moon { display: none; }
html[data-theme="dark"] .tm-theme .tm-ico-sun { display: block; }
html:not([data-theme]) .tm-theme { display: none; } /* scripts off: nothing to switch */

/* Narrow screens: the plans link goes, and the bar tightens so the logo, the login pill and the
   light/dark switch fit on one line down to 360 px. */
@media (max-width: 520px) {
  .tm-nav-plans { display: none; }
  .tm-top-row { gap: 8px; }
  .tm-brand { gap: 6px; }
  .tm-nav { gap: 4px; }
  .tm-nav a { padding-inline: 10px; }
  .tm-theme { width: 36px; height: 36px; }
}
@media (max-width: 420px) {
  .tm-wordmark { font-size: 1.25rem; }
  .tm-mark { width: 30px; height: 30px; }
}
@media (max-width: 400px) {
  .tm-wordmark { font-size: 1.04rem; }
  .tm-mark { width: 26px; height: 26px; }
  .tm-tag { font-size: .58rem; padding-inline: 5px; letter-spacing: .08em; }
  .tm-nav { font-size: .86rem; }
  .tm-nav a { padding-inline: 9px; }
  .tm-theme { width: 34px; height: 34px; }
}
@media (max-width: 359px) {
  .tm-tag { display: none; }
}

/* Buttons */
.tm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; text-align: center; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.tm-btn:active { transform: translateY(1px); }
.tm-btn-primary { background: var(--tm-accent); color: var(--tm-accent-ink); }
.tm-btn-primary:hover { background: var(--tm-accent-strong); }
.tm-btn-ghost { background: var(--tm-surface); color: var(--tm-text); border-color: var(--tm-line); }
.tm-btn-ghost:hover { border-color: var(--tm-accent); }
.tm-btn-light { background: var(--tm-band-ink); color: var(--tm-band); }
.tm-btn-outline-light { color: var(--tm-band-ink); border-color: color-mix(in srgb, var(--tm-band-ink) 40%, transparent); }
.tm a:focus-visible, .tm button:focus-visible { outline: 3px solid var(--tm-accent); outline-offset: 3px; }

/* Hero */
.tm-hero { padding-block: 48px 56px; }
.tm-hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .tm-hero-grid { grid-template-columns: 1.1fr .9fr; } .tm-hero { padding-block: 72px 80px; } }
.tm-hero-copy { display: grid; gap: 18px; min-width: 0; }
.tm-eyebrow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--tm-accent-soft); color: var(--tm-accent-strong); font-size: .85rem; font-weight: 600; }
.tm-hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.25; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.tm-lead { font-size: 1.1rem; color: var(--tm-muted); max-width: 52ch; }
.tm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tm-note { display: inline-flex; align-items: center; gap: 8px; color: var(--tm-ok); font-size: .92rem; font-weight: 500; }
.tm-note a, .tm-cta p a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.tm-hero-visual { display: grid; place-items: center; min-width: 0; }
.tm-phone { width: 300px; max-width: 100%; aspect-ratio: 9 / 18.5; border-radius: 40px; border: 10px solid var(--tm-text); background: var(--tm-surface); overflow: hidden; box-shadow: var(--tm-shadow); }
.tm-phone iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 899px) { .tm-phone { display: none; } }

.tm-scan { position: relative; width: min(340px, 100%); display: grid; gap: 14px; }
.tm-scan-card { display: grid; justify-items: center; gap: 10px; padding: 26px; border-radius: var(--tm-radius); background: var(--tm-band); color: var(--tm-band-ink); box-shadow: var(--tm-shadow); font-weight: 600; }
.tm-scan-qr { width: 96px; height: 96px; color: var(--tm-band-ink); }
.tm-scan-menu { list-style: none; margin: 0; padding: 8px 18px; border-radius: var(--tm-radius); background: var(--tm-surface); border: 1px solid var(--tm-line); box-shadow: var(--tm-shadow); }
.tm-scan-menu li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--tm-line); }
.tm-scan-menu li:last-child { border-bottom: 0; }
.tm-scan-menu b { font-variant-numeric: tabular-nums; color: var(--tm-accent); }

/* Sections */
.tm-section { padding-block: 56px; }
.tm-alt { background: var(--tm-surface-2); }
.tm-h2 { font-size: clamp(1.4rem, 3.6vw, 2rem); line-height: 1.3; font-weight: 700; text-wrap: balance; margin-bottom: 26px !important; }
.tm-facts, .tm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.tm-fact, .tm-step { display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: var(--tm-radius); background: var(--tm-surface); border: 1px solid var(--tm-line); }
.tm-fact h3, .tm-step h3 { font-size: 1.08rem; }
.tm-fact p, .tm-step p { color: var(--tm-muted); font-size: .95rem; }
.tm-fact-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--tm-accent-soft); color: var(--tm-accent-strong); }
.tm-step-num { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--tm-accent); color: var(--tm-accent-ink); font-weight: 700; }

.tm-cta { display: grid; gap: 14px; justify-items: start; padding: clamp(26px, 5vw, 48px); border-radius: calc(var(--tm-radius) + 6px); background: var(--tm-band); color: var(--tm-band-ink); }
.tm-cta .tm-h2 { margin-bottom: 0 !important; }
.tm-cta p { opacity: .8; }

.tm-foot { border-top: 1px solid var(--tm-line); padding-block: 22px; color: var(--tm-muted); font-size: .88rem; }
.tm-foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }

/* "Here by mistake?" */
.tm-mistake { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(8, 10, 18, .55); backdrop-filter: blur(4px); }
.tm-mistake[hidden] { display: none; }
.tm-mistake-box { position: relative; width: min(460px, 100%); display: grid; gap: 14px; padding: 30px 24px 24px; border-radius: 22px; background: var(--tm-surface); color: var(--tm-text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: tm-pop .22s ease-out; }
.tm-mistake-box h2 { font-size: 1.35rem; line-height: 1.35; padding-inline-end: 30px; }
.tm-mistake-box p { color: var(--tm-muted); }
.tm-mistake-box strong { color: var(--tm-text); }
.tm-mistake-box bdi { white-space: nowrap; }
.tm-mistake-actions { display: grid; gap: 10px; margin-top: 6px; }
.tm-mistake-actions .tm-btn { width: 100%; }
.tm-mistake-close { position: absolute; top: 14px; inset-inline-end: 14px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--tm-surface-2); color: var(--tm-muted); cursor: pointer; }
@keyframes tm-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.tm-backbar { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); inset-inline-start: 16px; z-index: 20; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: var(--tm-band); color: var(--tm-band-ink) !important; text-decoration: none; font-weight: 600; font-size: .92rem; box-shadow: var(--tm-shadow); }
.tm-backbar[hidden] { display: none; }
.tm-backbar .ico { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  .tm-mistake-box { animation: none; }
  .tm-btn { transition: none; }
}
