@font-face {
  font-family: "cairo";
  src: url("Cairo-Regular.ttf") format("truetype");
}

:root {
  --brand: #006495;
  --stage: #ffffff;
  --ink: #0b2a3a;
  --muted: #5b7180;
  --card-bg: #ffffff;
  --page-bg: #f4f8fb;
  --card-border: rgba(0, 100, 149, 0.12);
  --stage-border: transparent;
  --card-shadow: 0 24px 60px -20px rgba(0, 100, 149, 0.22);
  --dot-idle: rgba(0, 100, 149, 0.22);
  --track: rgba(0, 100, 149, 0.09);
  --brand-soft: #5fb2dc;
  color-scheme: light;
}

/* Dark splash. `data-theme` is set by the inline script in index.html from the
   app's saved appearance (System/Light/Dark), so the page before Flutter
   matches the app that replaces it. */
:root[data-theme="dark"] {
  --brand: #4fa8e0;
  --stage: #16212a;
  --ink: #e2ebf1;
  --muted: #9db2c0;
  --card-bg: #16212a;
  --page-bg: #0e171e;
  --card-border: rgba(143, 200, 240, 0.12);
  --card-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --dot-idle: rgba(143, 200, 240, 0.25);
  --track: rgba(143, 200, 240, 0.12);
  --brand-soft: #8cc8f0;
  color-scheme: dark;
}

:root[data-theme="dark"] body {
  background-color: var(--page-bg);
}

/* The two full-screen notices carry inline light styles. */
:root[data-theme="dark"] #tab-blocked-page,
:root[data-theme="dark"] #native-app-page {
  background: var(--page-bg) !important;
}

:root[data-theme="dark"] #tab-blocked-page h2,
:root[data-theme="dark"] #native-app-page h2 {
  color: var(--ink) !important;
}

:root[data-theme="dark"] #tab-blocked-page p,
:root[data-theme="dark"] #native-app-page p {
  color: var(--muted) !important;
}

#loading-page {
  position: fixed;
  inset: 0;
  background-color: var(--page-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "cairo";
  direction: rtl;
}

#card {
  width: min(680px, 92vw);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#brand-name {
  font-size: 20px;
  font-weight: bold;
  color: var(--brand);
  margin: 0 0 22px;
  text-align: center;
}

/* Carousel stage — hugs the image with light padding, not the full card width */
#stage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 12px;
  background: var(--stage);
  border: 1px solid var(--stage-border);
  border-radius: 18px;
  overflow: hidden;
}

#slide-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Caption — fixed min-height reserves space for a 2-line subtitle so the
   dots/progress below never shift between slides */
#caption {
  text-align: center;
  min-height: 84px;
  margin-top: 18px;
  transition: opacity 0.3s ease;
}

#slide-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--ink);
  margin: 0 0 6px;
}

#slide-sub {
  font-size: 18px;
  font-weight: bold;
  color: var(--brand);
  margin: 0;
}

/* Fade state applied during slide swap */
.fade #slide-img,
.fade #caption {
  opacity: 0;
}

.fade #slide-img {
  transform: scale(0.98);
}

/* Dots */
#dots {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

#dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-idle);
  transition: width 0.3s ease, background 0.3s ease;
}

#dots span.active {
  width: 22px;
  border-radius: 6px;
  background: var(--brand);
}

/* Loading row: the label and the percentage over a slim bar */
#loading-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(300px, 82%);
  margin: 26px auto 0;
}

/* The loading page is laid out right to left; in English and Turkish the
   label, the percentage and the fill follow the language instead. */
html[dir="ltr"] #loading-row {
  direction: ltr;
}

#progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#loading-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

#progress-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

#progress {
  position: relative;
  height: 6px;
  border-radius: 100px;
  background: var(--track);
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-soft), var(--brand));
  /* Scaled, not resized: the bar never forces a layout while the engine
     boots. The easing lets each jump of the count land softly. */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

html[dir="rtl"] #progress-fill {
  background: linear-gradient(270deg, var(--brand-soft), var(--brand));
  transform-origin: right center;
}

/* No sizes to measure against: a marching bar and no number */
#progress.indeterminate #progress-fill {
  width: 40%;
  transform: none;
  transition: none;
  animation: indeterminate 1.3s ease-in-out infinite;
}

html[dir="rtl"] #progress.indeterminate #progress-fill {
  animation-name: indeterminate-rtl;
}

@keyframes indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

@keyframes indeterminate-rtl {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-300%); }
}

/* Responsive */
@media (max-width: 520px) {
  #card { padding: 24px 18px 22px; border-radius: 20px; }
  #slide-img { max-height: 200px; }
  #brand-name { font-size: 18px; }
  #slide-title { font-size: 20px; }
  #slide-sub { font-size: 16px; }
}

/* Respect users who prefer reduced motion: no fades, no marching bar */
@media (prefers-reduced-motion: reduce) {
  #slide-img,
  #caption,
  #dots span {
    transition: none;
  }
  #progress-fill {
    transition: none;
  }
  #progress.indeterminate #progress-fill {
    animation: none;
    width: 0;
  }
}

/* The product shots carry an opaque white ground; frame it rather than leave
   a hard white rectangle on the dark card. */
:root[data-theme="dark"] #slide-img {
  border-radius: 12px;
}
