/*
 * Shared stylesheet for all testy.cloud sites.
 * Plain CSS, no build step. Light/dark follows the system (prefers-color-scheme), no manual switch.
 * Each app page sets its own accent with --accent / --accent-strong / --hero-* on <body>.
 */

:root {
  color-scheme: light dark;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);

  --accent: #0b4377;
  --accent-strong: #0b4377;
  --accent-soft: rgba(11, 67, 119, 0.08);
  --hero-from: #0b4377;
  --hero-to: #0f5a8f;

  --radius: 16px;
  --radius-small: 12px;
  --page-width: 960px;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: none;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 17px;
  /* Follows the iOS text size (Dynamic Type) inside WKWebView / Safari; ignored elsewhere. */
  font: -apple-system-body;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; margin: 0; }

.wrap {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.muted { color: var(--text-muted); }

.app-icon {
  border-radius: 22.37%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

/* ---------- App landing page ---------- */

.hero {
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: #fff;
  padding: calc(48px + env(safe-area-inset-top)) 0 56px;
  text-align: center;
}

.hero .app-icon { width: 128px; height: 128px; margin: 0 auto 20px; }
.hero h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; }
.hero .tagline { font-size: 1.15rem; opacity: 0.85; margin: 8px 0 28px; }
.hero .badge img { height: 54px; width: auto; margin: 0 auto; }

.section { padding: 56px 0; }
.section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 32px;
}

.screens {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 860px) { .screens { grid-template-columns: repeat(2, 1fr); } }

.screen { margin: 0; text-align: center; }

/* iPhone-style device frame drawn around the screenshot (sizes are % of the frame width, so it scales) */
.screen picture {
  --frame: 240px;
  position: relative;
  display: block;
  width: 100%;
  max-width: var(--frame);
  margin: 0 auto 18px;
  padding: 3.6%;
  border-radius: 16% / 7.4%;
  background: linear-gradient(145deg, #4a4a4f, #1c1c1e 45%, #3a3a3e);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.18),
    inset 0 0 0 4px #0b0b0c,
    0 18px 40px rgba(0, 0, 0, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.12);
}
.screen picture img {
  width: 100%;
  border-radius: 12.6% / 5.8%;
  background: #000;
}
/* Dynamic Island */
.screen picture::before {
  content: "";
  position: absolute;
  top: 5.4%;
  left: 50%;
  width: 31%;
  height: 3.6%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}
/* power button */
.screen picture::after {
  content: "";
  position: absolute;
  top: 24%;
  right: -2px;
  width: 3px;
  height: 11%;
  border-radius: 0 2px 2px 0;
  background: #3a3a3e;
}
@media (prefers-color-scheme: dark) {
  .screen picture {
    background: linear-gradient(145deg, #5a5a60, #2a2a2e 45%, #48484d);
    box-shadow:
      inset 0 0 0 1.5px rgba(255, 255, 255, 0.22),
      inset 0 0 0 4px #0b0b0c,
      0 18px 40px rgba(0, 0, 0, 0.6);
  }
}
.screen figcaption strong { display: block; font-size: 1.02rem; }
.screen figcaption span { color: var(--text-muted); font-size: 0.9rem; }

.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }

.features li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 14px 16px 14px 46px;
  position: relative;
}
.features li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 17px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%235dcaa5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.cta {
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta p { max-width: 560px; margin: 0 auto 24px; color: var(--text-muted); }
.cta .badge img { height: 54px; width: auto; margin: 0 auto; }

.site-footer {
  padding: 32px 0 calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-bottom: 12px; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- FAQ (shown in the app's web view) ---------- */

.faq-page { padding-top: env(safe-area-inset-top); }

.faq-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 0 8px;
}
.faq-header .app-icon { width: 52px; height: 52px; box-shadow: none; }
.faq-header h1 { font-size: 1.5rem; font-weight: 700; }
.faq-header p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.95rem; }

.faq-group { margin-top: 28px; }
.faq-group h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 8px 16px;
}

.faq-list {
  background: var(--surface);
  border-radius: var(--radius-small);
  overflow: hidden;
}

.faq-list details + details { border-top: 1px solid var(--border); }

.faq-list summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 44px 14px 16px;
  position: relative;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq-list details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-list summary:active { background: var(--accent-soft); }
.faq-list summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.faq-answer { padding: 0 16px 16px; color: var(--text); }
.faq-answer p { margin: 0 0 10px; }
.faq-answer p:last-child, .faq-answer ul:last-child, .faq-answer ol:last-child { margin-bottom: 0; }
.faq-answer ul, .faq-answer ol { margin: 0 0 10px; padding-left: 1.3em; }
.faq-answer li + li { margin-top: 4px; }

/* App UI labels the user should look for, e.g. Nastavení › O aplikaci */
.ui {
  font-weight: 600;
  white-space: nowrap;
}

.faq-contact {
  margin: 32px 0 0;
  padding: 24px 16px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-small);
}
.faq-contact h2 { font-size: 1.1rem; margin-bottom: 6px; }
.faq-contact p { margin: 0 0 16px; color: var(--text-muted); }

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.faq-page .site-footer { padding-top: 24px; }

/* ---------- Crossroads (testy.cloud) ---------- */

.crossroads-header { padding: calc(56px + env(safe-area-inset-top)) 0 32px; text-align: center; }
.crossroads-header h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; }
.crossroads-header p { color: var(--text-muted); margin: 8px 0 0; }

.app-grid {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 600px) { .app-grid { grid-template-columns: 1fr; } }

.app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.app-card .app-icon { width: 64px; height: 64px; flex: none; box-shadow: none; border: 1px solid var(--border); }
.app-card strong { display: block; font-size: 1.05rem; }
.app-card span { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- App themes ---------- */

.theme-ham {
  --accent: #0b4377;
  --accent-strong: #0b4377;
  --accent-soft: rgba(11, 67, 119, 0.08);
  --hero-from: #0b4377;
  --hero-to: #136a9e;
}
@media (prefers-color-scheme: dark) {
  .theme-ham {
    --accent: #7cc4f0;
    --accent-strong: #1f6fae;
    --accent-soft: rgba(124, 196, 240, 0.14);
    --hero-from: #06294a;
    --hero-to: #0b4377;
  }
}
