/* RefOS – úvodní web. Paleta převzatá z appky (Officiating/app/css/styles.css). */
:root {
  --navy-900: #0f172a;
  --navy-700: #1e3a8a;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff6ff;
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #475569;
  --bg: #f5f7fa;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --border: #e2e8f0;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --wrap: 1120px;
  --zebra-stage: #e6eefa;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-soft: #1a2b47;
    --ink: #f1f5f9;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --bg: #0b1120;
    --bg-alt: #0f172a;
    --card: #131c31;
    --border: #243049;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --zebra-stage: #cbd5e1;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0; }
p { margin: 0; }
code { font-size: 0.92em; background: var(--primary-soft); color: var(--ink); padding: 0.1em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.65rem 1.25rem;
  border-radius: 10px; border: 1px solid transparent; background: transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-sm { min-height: 36px; padding: 0.35rem 0.85rem; font-size: 0.9rem; }
.btn-lg { min-height: 52px; padding: 0.8rem 1.75rem; font-size: 1.1rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn:focus-visible, .lang-switch button:focus-visible, .main-nav a:focus-visible, .brand:focus-visible {
  outline: 3px solid #93c5fd; outline-offset: 2px;
}

/* ---------- Hlavička ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; border-radius: 8px; }
.main-nav { display: flex; gap: 1.5rem; margin-left: auto; }
.main-nav a { color: #cbd5e1; text-decoration: none; font-size: 0.95rem; border-radius: 4px; }
.main-nav a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.lang-switch { display: flex; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px; overflow: hidden; }
.lang-switch button {
  font: inherit; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
  background: transparent; color: #cbd5e1; border: 0; min-height: 36px; min-width: 40px; padding: 0 0.6rem; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--navy-900); }
/* Přihlášení – rozbalovací seznam asociací */
.login-menu { position: relative; }
.login-toggle .chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.login-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.login-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.login-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: 300px; max-width: calc(100vw - 32px);
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
}
.login-list[hidden] { display: none; }
.login-list-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 6px 8px 8px; }
.login-org {
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: 8px; border-radius: 8px; color: var(--text); text-decoration: none;
}
.login-org:hover, .login-org:focus-visible { background: var(--primary-soft); }
.login-org:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.org-logo { flex: none; width: 56px; height: 40px; display: grid; place-items: center; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.org-logo img { width: 100%; height: 100%; object-fit: contain; }
.org-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.org-text b { color: var(--ink); }
.org-text small { color: var(--muted); font-size: 0.8rem; }

@media (max-width: 820px) {
  .main-nav { display: none; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 360px) {
  .header-inner { gap: 0.5rem; }
  .brand span { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #e2e8f0;
  padding: 64px 0 80px;
}
/* Rozhodčí pruhy jako jemný motiv v pozadí */
.hero::before {
  content: ""; position: absolute; inset: 0 -20% 0 55%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 28px, transparent 28px 56px);
  transform: skewX(-12deg);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
@media (max-width: 900px) {
  .hero { padding: 40px 0 56px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
.eyebrow { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #93c5fd; margin-bottom: 0.75rem; }
.eyebrow.dark { color: var(--primary); }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.2rem); color: #cbd5e1; margin-top: 1.25rem; max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-note { margin-top: 1.25rem; font-size: 0.9rem; color: #94a3b8; }

/* Náhled appky (čistě ilustrace, smyšlená data) */
.hero-visual { position: relative; }
.mock {
  background: #f5f7fa; border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #1e293b; font-size: 13px;
}
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #e2e8f0; }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.mock-bar em { margin-left: 10px; font-style: normal; font-size: 11px; color: #64748b; background: #fff; border-radius: 6px; padding: 2px 10px; }
.mock-body { display: flex; min-height: 300px; }
.mock-side { width: 52px; flex: none; background: linear-gradient(180deg, var(--navy-900), var(--navy-700)); padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.mock-side i { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); }
.mock-side i.on { background: #60a5fa; }
.mock-main { flex: 1; min-width: 0; padding: 14px; }
.mock-day { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 12px; }
.mock-day-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mock-day-head b { font-size: 14px; color: #0f172a; }
.mock-badge { font-size: 11px; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 2px 8px; }
.mock-match { border-top: 1px solid #eef2f7; padding: 9px 0; }
.mock-match-top { display: flex; gap: 10px; min-width: 0; }
.mock-match-top b { color: #1d4ed8; flex: none; }
.mock-match-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-match.flag .mock-match-top b { color: #b45309; }
.mock-crew { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.pos { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; min-width: 30px; text-align: center; }
.pos.ok { background: #dcfce7; color: #166534; }
.pos.wait { background: #fef3c7; color: #92400e; }
.pos.open { background: #fff; color: #b91c1c; border: 1px dashed #f87171; }
.toast {
  position: absolute; right: -8px; bottom: -28px;
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: #1e293b; border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  font-size: 13px; max-width: 280px;
  animation: toast-in 0.6s ease-out 0.8s both;
}
.toast img { border-radius: 6px; flex: none; }
.toast b { display: block; color: #0f172a; }
.toast span { color: #64748b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .toast { right: 8px; } }
@media (max-width: 480px) {
  .mock-side { width: 36px; padding: 12px 8px; }
  .toast { position: relative; right: auto; bottom: auto; margin: -20px 12px 0 auto; }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- Sekce ---------- */
.section { padding: 80px 0; }
@media (max-width: 720px) { .section { padding: 56px 0; } }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.25rem); letter-spacing: -0.015em; max-width: 26em; }
.section-lead { margin-top: 1rem; font-size: 1.1rem; color: var(--muted); max-width: 40em; }

/* Před / po */
.problem { background: var(--bg-alt); }
.problem-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 24px; align-items: stretch; margin-top: 40px; }
.problem-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: var(--card); }
.problem-item h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.problem-item.after { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.problem-item.after h3 { color: var(--primary); }
.problem-item ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.problem-item li { position: relative; padding-left: 26px; }
.problem-item li::before { content: "✕"; position: absolute; left: 0; color: #dc2626; font-weight: 700; }
.problem-item.after li::before { content: "✓"; color: var(--ok); }
.problem-arrow { align-self: center; font-size: 2rem; color: var(--primary); }
.problem-more { margin-top: 28px; text-align: center; }
@media (max-width: 760px) {
  .problem-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .problem-arrow { transform: rotate(90deg); justify-self: center; }
}

/* Funkce */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; margin-top: 40px; }
@media (max-width: 360px) { .feature-grid { grid-template-columns: minmax(0, 1fr); } }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; margin-bottom: 16px; }
.feature-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--muted); }

/* Zebra */
.zebra-section { background: var(--bg); }
.zebra-inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
@media (max-width: 820px) { .zebra-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.zebra-art { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.zebra-art svg {
  width: 100%; max-width: 340px; height: auto;
  /* Světlý kruh za zebrou – obrys (#1f2229) by v tmavém režimu splýval s pozadím */
  background: radial-gradient(circle closest-side at 48% 52%, var(--zebra-stage) 0 98%, transparent 100%);
}
.zebra-copy p:not(.eyebrow) { margin-top: 1rem; color: var(--muted); font-size: 1.05rem; }
.bubble {
  position: relative; max-width: 280px; background: #fffbe6; color: #1f2229;
  border: 2px solid #1f2229; border-radius: 14px; padding: 8px 14px; font-size: 0.95rem; font-weight: 600;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.12);
}
.bubble::after { content: ""; position: absolute; left: 62%; bottom: -17px; border: 8px solid transparent; border-top-color: #1f2229; }
.zebra .tail { transform-origin: 84px 148px; animation: wag 1.2s ease-in-out infinite; }
.zebra .whole { animation: bounce 1.6s ease-in-out infinite; }
.zebra .eye-open { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes wag { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@media (prefers-reduced-motion: reduce) { .zebra * { animation: none !important; } }

/* Vlastní instance */
.instance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 40px; }
@media (max-width: 360px) { .instance-grid { grid-template-columns: minmax(0, 1fr); } }
.instance-item { padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); }
.instance-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; margin-bottom: 14px; }
.instance-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.instance-item p { color: var(--muted); }

/* Nasazeno */
.inuse { padding-top: 0; }
.inuse-card {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #cbd5e1; border-radius: 20px; padding: 40px;
}
@media (max-width: 720px) { .inuse-card { padding: 28px 20px; } }
.inuse-copy { flex: 1 1 22em; max-width: 40em; }
/* Logo asociace je modré na průhledném pozadí – na tmavém podkladu potřebuje bílou dlaždici */
.inuse-logo { flex: none; background: #fff; border-radius: 14px; padding: 14px 18px; }
.inuse-logo img { width: 132px; height: auto; }
.inuse-card h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 0.75rem; }

/* Kontakt */
.contact { background: var(--bg); text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact .section-title, .contact .section-lead { margin-left: auto; margin-right: auto; }
.contact .btn { margin-top: 2rem; max-width: 100%; overflow-wrap: anywhere; }

/* Patička */
.site-footer { background: var(--navy-900); color: #94a3b8; font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.site-footer a { color: #cbd5e1; }

/* Galerie ukázek appky */
/* Střídání pozadí: problém alt, funkce bg, galerie alt, zebra bg, pro asociace + V provozu alt, kontakt bg */
.tour, .instance, .inuse { background: var(--bg-alt); }
.tour-tabs {
  display: flex; gap: 8px; margin-top: 32px;
  overflow-x: auto; scrollbar-width: none; padding: 4px 2px;
}
.tour-tabs::-webkit-scrollbar { display: none; }
.tour-tabs [role="tab"] {
  flex: none; font: inherit; font-size: 0.95rem; font-weight: 600;
  min-height: 40px; padding: 0.4rem 1rem; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--muted); border: 1px solid var(--border);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.tour-tabs [role="tab"]:hover { color: var(--ink); border-color: var(--primary); }
.tour-tabs [role="tab"][aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.tour-tabs [role="tab"]:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.tour-panel { margin-top: 20px; }
.tour-frame {
  position: relative; border-radius: 14px; overflow: hidden; background: #f5f7fa;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18), 0 0 0 1px var(--border);
}
.tour-frame .mock-bar { background: #e2e8f0; }
.tour-img-link { display: block; }
.tour-img-link img { width: 100%; height: auto; aspect-ratio: 1440 / 900; background: #f5f7fa; }
.tour-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  /* Bílé – na screenshotu je vlevo tmavé menu appky, vpravo světlá plocha */
  background: rgba(255, 255, 255, 0.95); color: #0f172a;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: background-color 0.15s;
}
.tour-nav:hover { background: var(--primary); color: #fff; }
.tour-nav:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.tour-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tour-prev { left: 12px; }
.tour-next { right: 12px; }
.tour-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 16px; }
.tour-caption { color: var(--muted); font-size: 1.02rem; max-width: 52em; }
.tour-count { flex: none; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .tour-nav { width: 36px; height: 36px; }
  .tour-prev { left: 6px; }
  .tour-next { right: 6px; }
}
