/* ShowMyTime — Premiers pas in the app (two steps per landscape slide)
   Brand tokens from Flutter DesignTokens / design-tokens.css */

:root {
  --bg: #e5e7eb;
  --bg-warm: #ede9fe;
  --bg-soft: #f5f3ff;
  --ink: #1f2937;
  --ink-muted: #6b7280;
  --line: #d1d5db;
  --accent: #8e2de2;
  --accent-dark: #4a00e0;
  --accent-600: #7b22c7;
  --accent-soft: rgba(142, 45, 226, 0.14);
  --ok: #047857;
  --phone-frame: #111827;
  --phone-screen: #e5e7eb;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.16);
  --font-display: "Montserrat", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #111827;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 1.5vh 1.5vw;
}

.deck {
  width: min(100vw - 3vw, calc((100dvh - 3vh) * 16 / 9));
  height: min(100dvh - 3vh, calc((100vw - 3vw) * 9 / 16));
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(110% 80% at 8% 12%, #ffffff 0%, transparent 52%),
    radial-gradient(90% 70% at 92% 88%, var(--bg-warm) 0%, transparent 48%),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-soft) 100%);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  box-shadow: var(--shadow);
}

.chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1% 2.2% 0.35%;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.brand-name {
  font-weight: 700;
  font-size: clamp(0.85rem, 1.5vw, 1.15rem);
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sep,
.brand-sub {
  color: var(--ink-muted);
  font-weight: 600;
  font-size: clamp(0.68rem, 1.1vw, 0.88rem);
}

.chrome-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress {
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.7rem, 1.15vw, 0.88rem);
  color: var(--ink-muted);
  font-weight: 500;
}

.btn-ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-muted);
  font: inherit;
  font-size: clamp(0.65rem, 1.05vw, 0.8rem);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--accent-600);
}

/* Secondary exit link — chrome (all slides); not .btn-ghost so mobile keeps it */
.btn-back-guide {
  text-decoration: none;
  border: 1px solid rgba(142, 45, 226, 0.35);
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-600);
  font: inherit;
  font-size: clamp(0.65rem, 1.05vw, 0.8rem);
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-back-guide:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
}

/* Primary CTA — done / « C'est bon » slide only */
.btn-back-cta {
  display: none;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 1.35rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 24px rgba(142, 45, 226, 0.28);
}

.btn-back-cta:hover {
  filter: brightness(1.06);
}

.deck[data-variant="done"] .btn-back-cta {
  display: inline-flex;
}

/* —— Slide layouts —— */
.slide {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 0;
  padding: 0 1.6% 0.4%;
  gap: 0;
  align-items: stretch;
}

.deck[data-layout="solo"] .slide {
  grid-template-columns: 1fr;
}

.deck[data-layout="solo"] .pane-half,
.deck[data-layout="solo"] .v-sep {
  display: none !important;
}

.deck[data-layout="pair"] .pane-solo {
  display: none !important;
}

.pane {
  min-width: 0;
  min-height: 0;
}

.pane-solo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2% 8%;
  max-width: 36rem;
  margin: 0 auto;
}

.section-tag {
  margin: 0 0 0.5rem;
  font-size: clamp(0.7rem, 1.15vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.step-number {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 12vw, 9rem);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--accent);
}

.step-title {
  margin: 1rem 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.8vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 18ch;
}

.step-action {
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
  max-width: 28ch;
}

.step-hint {
  margin: 0.9rem 0 0;
  font-size: clamp(0.78rem, 1.15vw, 0.95rem);
  color: var(--ink-muted);
  max-width: 34ch;
  line-height: 1.45;
}

/* Half panes (two steps) */
.pane-half {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.4%;
  padding: 0.4% 2% 1%;
  min-height: 0;
}

.half-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 0;
}

.half-badge {
  display: inline-block;
  font-size: clamp(0.55rem, 0.9vw, 0.7rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid rgba(142, 45, 226, 0.28);
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.15rem;
}

.half-badge[hidden] {
  display: none;
}

.half-number {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.half-caption {
  margin: 0;
  font-size: clamp(0.85rem, 1.45vw, 1.15rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  max-width: 22ch;
}

.v-sep {
  width: 2px;
  align-self: stretch;
  margin: 1.5% 0 2.5%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--accent) 18%,
    var(--accent-dark) 50%,
    var(--accent) 82%,
    transparent 100%
  );
  opacity: 0.55;
  border-radius: 2px;
}

.phone {
  height: 100%;
  max-height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 9 / 19.5;
  margin: 0 auto;
  display: grid;
  place-items: stretch;
  min-height: 0;
}

.phone-bezel {
  background: var(--phone-frame);
  border-radius: 12% / 6%;
  padding: 2.6% 3% 3.2%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 14px 32px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.phone-notch {
  width: 34%;
  height: 2.4%;
  margin: 0 auto 1.8%;
  background: #0a0b0e;
  border-radius: 999px;
  flex-shrink: 0;
}

.phone-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 8% / 4%;
  overflow: hidden;
  background: var(--phone-screen);
}

.slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  background: #fff;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3% 2.2% 1.1%;
  gap: 1rem;
}

.btn-nav {
  appearance: none;
  width: clamp(2.2rem, 3.5vw, 2.8rem);
  height: clamp(2.2rem, 3.5vw, 2.8rem);
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
}

.btn-nav:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
}

.btn-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.nav-hint {
  margin: 0;
  font-size: clamp(0.65rem, 1.05vw, 0.8rem);
  color: var(--ink-muted);
}

.deck[data-variant="welcome"] .step-number,
.deck[data-variant="done"] .step-number {
  color: var(--accent);
}

/*
 * Narrow viewports (phone portrait): one step at a time, full-bleed.
 * Desktop / landscape (≥701px): keep two columns unchanged.
 * JS sets data-mobile-half="left"|"right" and flattens navigation.
 */
@media (max-width: 700px) {
  body {
    padding: 0;
    place-items: stretch;
  }

  .deck {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    aspect-ratio: auto;
  }

  .chrome {
    padding: 0.75rem 1rem 0.35rem;
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-sep,
  .brand-sub {
    font-size: 0.78rem;
  }

  .progress {
    font-size: 0.85rem;
  }

  .chrome-right .btn-ghost {
    display: none;
  }

  .btn-back-guide {
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem;
  }

  .btn-back-cta {
    margin-top: 1.5rem;
    font-size: 1rem;
    padding: 0.85rem 1.4rem;
  }

  .deck[data-layout="pair"] .slide {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .deck[data-layout="pair"] .v-sep {
    display: none !important;
  }

  /* Default / left half: hide right. Right half: swap visibility. */
  .deck[data-layout="pair"] #pane-right {
    display: none !important;
  }

  .deck[data-layout="pair"][data-mobile-half="right"] #pane-left {
    display: none !important;
  }

  .deck[data-layout="pair"][data-mobile-half="right"] #pane-right {
    display: grid !important;
  }

  .pane-half {
    grid-template-rows: auto 1fr;
    gap: 0.55rem;
    padding: 0.35rem 1rem 0.5rem;
  }

  .half-badge {
    font-size: clamp(0.7rem, 3vw, 0.85rem);
    padding: 0.25rem 0.55rem;
  }

  .half-number {
    font-size: clamp(2.2rem, 12vw, 3.2rem);
  }

  .half-caption {
    font-size: clamp(1.15rem, 5.2vw, 1.45rem);
    max-width: none;
  }

  .phone {
    max-height: none;
    height: 100%;
    width: min(100%, calc((100dvh - 11.5rem) * 9 / 19.5));
  }

  .pane-solo {
    padding: 1.5rem 1.25rem;
    max-width: none;
  }

  .step-number {
    font-size: clamp(4rem, 22vw, 6rem);
  }

  .step-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
    max-width: none;
  }

  .step-action {
    font-size: clamp(1.05rem, 4.5vw, 1.25rem);
    max-width: none;
  }

  .step-hint {
    font-size: clamp(0.9rem, 3.8vw, 1.05rem);
    max-width: none;
  }

  .nav {
    padding: 0.45rem 1rem 1rem;
  }

  .btn-nav {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.2rem;
  }

  .nav-hint {
    font-size: 0.75rem;
  }
}
