/* Abo-Ticket — static UI recreation of the screen recorded in ui.mp4 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --bg: #E9E9E9;
  --sheet: #FCFCFC;
  --ink: #1A1A1A;
  --ink-title: #3C3C3C;
  --hairline: #C3C3C3;
  --db-red: #EC0016;
  --focus: #0B57D0;

  --pad: 20px;
  --nav-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --chrome-h: calc(var(--nav-h) + var(--safe-top));

  --qr-max: 440px;
  --wm-max: 440px;
  --tab-h: 65px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--chrome-h) + 10px);
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 20px;
  font-size-adjust: 0.52;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  overscroll-behavior-y: contain;
}

img, svg, canvas { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
  outline-offset: 0;
}

/* ---------- Fixed app chrome ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  padding-top: var(--safe-top);
  background: #E8E8E8;
  box-shadow: none;
  transition: background-color .22s ease;
}

.topbar.is-scrolled { background: transparent; }

.topbar-blur {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.topbar-blur-strong {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 8%, transparent 42%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 8%, transparent 42%);
}

.topbar-blur-mid {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 28%, transparent 68%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 28%, transparent 68%);
}

.topbar-blur-soft {
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%);
}

.navbar { position: relative; z-index: 1; height: var(--nav-h); }

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 14px;
}

.back-button {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.back-button::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .10), 0 1px 2px rgba(0, 0, 0, .05);
  transition: transform .12s ease, background-color .12s ease;
}

.back-button svg { position: relative; width: 9.5px; height: 16.5px; }
.back-button:active::before { background: #F1F1F1; transform: scale(.96); }

.navbar-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.015em;
  white-space: nowrap;
  color: var(--ink);
}

/* ---------- Ticket sheet ---------- */

.sheet {
  width: min(100%, 900px);
  margin: 0 auto;
  padding-top: var(--chrome-h);
  background: var(--sheet);
  box-shadow: none;
}

.ticket-head {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 59px;
  padding: 8px 20px 8px 24px;
  border-bottom: 1px solid var(--hairline);
}

.db-logo {
  flex: 0 0 auto;
  width: 39px;
  height: auto;
}

.ticket-head-text {
  font-size: 16px;
  line-height: 22px;
  letter-spacing: -.005em;
}

.ticket-name { margin: 0; font-size: inherit; line-height: inherit; font-weight: 700; color: var(--ink-title); }
.ticket-validity { color: var(--ink); }

.ticket-visual { padding: 8px max(var(--pad), 23px) 0; }

.tarif-track {
  position: relative;
  height: 30px;
  overflow: hidden;
}

.tarif-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: 30px;
  transform: translateX(0);
  animation: tarif-drift 2.6s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes tarif-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--tarif-travel, 0px)); }
}

.qr {
  width: 100%;
  max-width: var(--qr-max);
  height: auto;
  margin: 3px auto 0;
}

.qr-rule {
  width: min(100%, var(--qr-max));
  height: 0;
  margin: 3px auto 0;
  border: 0;
  border-top: 1px solid #2E2E2E;
}

.ticket-body {
  padding: 19px var(--pad) 107px;
}

.ticket-body-inner {
  max-width: 760px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
}

.ticket-body p { margin: 0; }

.ticket-body .section-title {
  margin: 7px 0 0;
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
}

.ticket-body .conditions-first { margin-bottom: 20px; }

.ticket-body .ticket-code { margin-top: 8px; }

.watermark-rule {
  width: min(calc(100% - 6px), var(--wm-max));
  margin: 32px auto 0;
  border: 0;
  border-top: 1px solid #D3D3D3;
}

.watermark {
  width: min(calc(100% - 6px), var(--wm-max));
  height: auto;
  margin: 0 auto;
}

.more-actions {
  display: block;
  width: 100%;
  height: 49px;
  margin: 38px auto 0;
  border: 1px solid #8E8E8E;
  border-radius: 4px;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .15s ease;
}

.more-actions:active { background: rgba(0, 0, 0, .045); }

/* ---------- Floating tab bar ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 40px), 440px);
  height: var(--tab-h);
  border-radius: 999px;
  background: rgba(247, 247, 247, .90);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05), inset 0 1px 0 rgba(255, 255, 255, .6);
  overflow: hidden;
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
}

.tab::before {
  content: "";
  position: absolute;
  inset: 5px -2px;
  border-radius: 26px;
  background: transparent;
  transition: background-color .18s ease;
}

.tab.is-active::before { background: rgba(0, 0, 0, .075); }

.tab svg { position: relative; width: 20px; height: 20px; }

.tab span {
  position: relative;
  font-size: 11.5px;
  line-height: 13px;
  font-weight: 600;
  letter-spacing: -.005em;
}

.tab:active { opacity: .62; }

.tab:focus-visible {
  outline-offset: -3px;
  border-radius: 999px;
}

/* ---------- Responsive ---------- */

@media (min-width: 600px) {
  :root { --pad: 24px; }

  .ticket-head { padding: 9px 24px; }
  .ticket-head-text { font-size: 17px; line-height: 23px; }

  .ticket-body { padding-top: 22px; }
  .ticket-body-inner { max-width: 640px; font-size: 17px; line-height: 22px; }

  .ticket-body .section-title { margin-top: 8px; }
  .ticket-body .conditions-first { margin-bottom: 22px; }
  .ticket-body .ticket-code { margin-top: 9px; }

  .tarif-track { height: 38px; }
  .tarif-logo { height: 38px; }
  .qr { margin-top: 12px; }

  .more-actions { height: 51px; font-size: 17px; margin-top: 40px; }
}

@media (min-width: 1024px) {
  :root { --pad: 32px; }

  .ticket-head { min-height: 60px; padding: 10px 28px; }
  .ticket-head-text { font-size: 17px; line-height: 24px; }

  .ticket-body { padding-top: 26px; }
  .ticket-body-inner { max-width: 760px; font-size: 18px; line-height: 24px; }

  .ticket-body .section-title { margin-top: 9px; }
  .ticket-body .conditions-first { margin-bottom: 24px; }
  .ticket-body .ticket-code { margin-top: 10px; }


  .qr { margin-top: 14px; }

  .watermark-rule { margin-top: 36px; }

  .more-actions { height: 52px; margin-top: 42px; font-size: 17px; }
}


@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar { background: #F6F6F6; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar-blur { display: none; }
  .tabbar { background: #F7F7F7; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .tarif-logo {
    animation: none !important;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media print {
  body { background: #fff; }

  .topbar, .tabbar, .more-actions, .skip-link { display: none !important; }

  .sheet {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .ticket-body { padding-bottom: 24px; }
  .watermark { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

@media (hover: hover) {
  .back-button:hover::before { background: #F7F7F7; }
  .more-actions:hover { background: rgba(0, 0, 0, .02); }
  .tab:not(.is-active):hover::before { background: rgba(0, 0, 0, .03); }
}
