/*
 * ePlanDia website: the styles of all four pages.
 * Design: the "Web eplandia.cz" page of the ePlanDia mockups canvas.
 * Colours: the app's tokens (apps/web/src/shared/theme/tokens.ts).
 * Mobile first: the base rules are the phone; 760px adds the tablet steps, 1000px the desktop.
 */

:root {
  --primary: #364c36;
  --primary-hover: #2d402d;
  --primary-active: #4a6449;
  --focus-on-dark: #b8ccaa;
  --secondary: #7d916f;
  --accent: #eabe60;
  --text: #1e2e1e;
  --text-secondary: #566256;
  --background: #f8faf5;
  --surface: #f1f5eb;
  --white: #ffffff;
  --border: #ccd6c0;
  --border-strong: #a2b290;
  --on-dark: rgba(255, 255, 255, 0.88);
  --on-dark-small: rgba(255, 255, 255, 0.86);
  --on-dark-line: rgba(255, 255, 255, 0.22);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-shot: 0 8px 24px rgba(30, 46, 30, 0.1);
  --radius: 12px;
  --radius-button: 8px;
  --gutter: 20px;
  --header-height: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (min-width: 760px) {
  :root {
    --gutter: 32px;
  }
}

@media (min-width: 1000px) {
  :root {
    --header-height: 72px;
  }
}

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

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
}

img,
svg {
  display: block;
}

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

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  color: var(--text);
  text-wrap: balance;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* The ring is the dark brand green on light grounds (the app's light ring #b8ccaa is too
   faint there) and the light ring on the dark band. */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.band-dark :focus-visible {
  outline-color: var(--focus-on-dark);
}

main:focus {
  outline: none;
}

section[id],
#prihlaseni {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.nowrap {
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: var(--radius-button);
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.skip-link:focus {
  top: 8px;
  color: var(--white);
}

/* ---------- Buttons and links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 15px 28px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--primary);
  color: var(--white);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-hover);
  color: var(--white);
}

.button:active {
  background: var(--primary-active);
}

.button-small {
  min-height: 44px;
  padding: 11px 20px;
  font-size: 15px;
}

/* Full width on the phone, its own width from 760px. */
.button-wide {
  display: flex;
  width: 100%;
}

@media (min-width: 760px) {
  .button-wide {
    display: inline-flex;
    width: auto;
  }
}

.text-link {
  font-size: 17px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: var(--header-height);
}

.brand {
  flex: 0 0 auto;
  border-radius: 4px;
}

.brand img {
  width: 118px;
}

.nav-desktop {
  display: none;
}

.nav-links {
  display: flex;
  gap: 26px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.nav-panel a[aria-current="page"] {
  font-weight: 700;
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav-links a:hover,
.back-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Phone menu: a <details>, so it works without JavaScript. */
.nav-phone summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--background);
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-phone summary::-webkit-details-marker {
  display: none;
}

.nav-phone[open] summary {
  border-color: var(--border-strong);
  background: var(--surface);
}

.nav-phone .icon-close,
.nav-phone[open] .icon-menu {
  display: none;
}

.nav-phone[open] .icon-close {
  display: block;
}

.nav-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 22px rgba(30, 46, 30, 0.1);
}

.nav-panel a:not(.button) {
  display: block;
  padding: 15px var(--gutter);
  border-bottom: 1px solid var(--surface);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
}

.nav-panel-cta {
  padding: 16px var(--gutter) 20px;
}

@media (min-width: 1000px) {
  .brand img {
    width: 148px;
  }

  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: auto;
  }

  .nav-phone {
    display: none;
  }
}

/* ---------- Sections ---------- */

.band {
  padding: 56px 0;
}

.band-surface {
  background: var(--surface);
}

.band-dark {
  background: var(--primary);
}

.band-pro-koho {
  padding: 48px 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-lead {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.65;
}

@media (min-width: 760px) {
  h2 {
    font-size: 27px;
  }

  .band {
    padding: 72px 0;
  }

  .band-pro-koho {
    padding: 64px 0;
  }

  .section-head {
    margin-bottom: 40px;
  }

  .section-lead {
    margin-top: 16px;
    font-size: 18px;
  }
}

@media (min-width: 1000px) {
  h2 {
    font-size: 30px;
  }

  .band {
    padding: 88px 0;
  }

  .band-pro-koho {
    padding: 80px 0;
  }

  .section-head {
    margin-bottom: 44px;
  }
}

/* ---------- 1 Hero ---------- */

.hero {
  padding: 36px 0 44px;
}

.hero-grid {
  display: grid;
  gap: 28px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 16px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero-lead {
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-desktop {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(30, 46, 30, 0.12);
}

.hero-media {
  position: relative;
}

/* Two overlapping screenshots are mush at phone width: the phone comes back in "Mobil". */
.hero-phone {
  display: none;
}

.phone-frame {
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(30, 46, 30, 0.14);
}

.phone-frame img {
  width: 100%;
  border-radius: 17px;
}

@media (min-width: 760px) {
  .hero {
    padding: 72px 0 80px;
  }

  .hero-grid {
    gap: 48px;
  }

  .eyebrow {
    margin-bottom: 16px;
    font-size: 13px;
  }

  .hero h1 {
    margin-bottom: 20px;
    font-size: 36px;
  }

  .hero-lead {
    margin-bottom: 32px;
    font-size: 18px;
  }

  .hero-actions {
    flex-direction: row;
    gap: 24px;
  }

  .hero-media {
    padding: 0 0 28px 48px;
  }

  .hero-phone {
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 136px;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(30, 46, 30, 0.18);
  }

  .hero-phone img {
    border-radius: 13px;
  }
}

@media (min-width: 1000px) {
  .hero {
    padding: 76px 0 92px;
  }

  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px;
    align-items: center;
  }

  .hero h1 {
    font-size: 40px;
    line-height: 1.16;
  }

  .hero-lead {
    font-size: 19px;
  }
}

/* ---------- 2 Pro koho ---------- */

.contrasts {
  display: grid;
  gap: 22px;
}

.contrasts li {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.contrast-label {
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contrast-text {
  font-size: 17px;
  line-height: 1.5;
}

/* The new RVP PV: one white box under the contrasts. No coloured edge stripe, on purpose. */
.rvp-note {
  margin-top: 36px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.rvp-note strong {
  color: var(--text);
  font-weight: 600;
}

.rvp-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

@media (min-width: 760px) {
  .contrasts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }

  .contrasts li {
    padding-top: 18px;
  }

  .contrast-label {
    margin-bottom: 8px;
  }

  .rvp-note {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-top: 48px;
    padding: 24px 28px;
    font-size: 17px;
  }

  .rvp-badge {
    flex: 0 0 auto;
    margin-bottom: 0;
  }
}

@media (min-width: 1000px) {
  .contrasts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- 2b Příběh (teaser of pribeh.html) ---------- */

.story-teaser {
  margin-bottom: 0;
}

.story-teaser .section-lead strong {
  font-weight: 600;
}

.story-teaser-link {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 17px;
}

@media (min-width: 760px) {
  .story-teaser-link {
    margin-top: 24px;
    font-size: 18px;
  }
}

/* ---------- 3 Funkce ---------- */

.cards {
  display: grid;
  gap: 16px;
}

.card {
  padding: 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.card-icon {
  margin-bottom: 14px;
  fill: none;
  stroke: var(--secondary);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.card p,
.steps p {
  color: var(--text-secondary);
}

.shots {
  display: grid;
  gap: 24px;
  align-items: start;
  margin-top: 28px;
}

.shots img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-shot);
}

.shots figcaption {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 760px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .card {
    padding: 28px 24px;
  }

  .card-icon {
    margin-bottom: 16px;
  }

  .card h3 {
    font-size: 18px;
  }

  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    margin-top: 56px;
  }

  .shots figcaption {
    margin-top: 12px;
  }
}

@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- 4 Mobilní aplikace ---------- */

.mobil-grid {
  display: grid;
  gap: 36px;
}

.mobil-text .section-lead {
  margin-bottom: 28px;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--text-secondary);
}

.checks li {
  display: flex;
  gap: 12px;
}

.checks svg {
  flex: 0 0 auto;
  margin-top: 4px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.install-box {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 15.5px;
}

.phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.phones .phone-frame {
  padding: 4px;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(30, 46, 30, 0.14);
}

.phones .phone-frame img {
  border-radius: 14px;
}

@media (min-width: 760px) {
  .install-box {
    padding: 20px 22px;
  }

  .phones {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 22px;
  }

  .phones .phone-frame {
    flex: 0 0 212px;
    padding: 5px;
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(30, 46, 30, 0.14);
  }

  .phones .phone-frame img {
    border-radius: 17px;
  }
}

@media (min-width: 1000px) {
  .mobil-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px;
    align-items: center;
  }

  .phones .phone-frame:nth-child(2) {
    margin-top: 48px;
  }
}

/* ---------- 5 Bezpečnost (the one dark band) ---------- */

.band-dark h2,
.band-dark h3 {
  color: var(--white);
}

.band-dark .section-lead {
  color: var(--on-dark);
}

.safety {
  display: grid;
  gap: 26px;
}

.safety li {
  padding-top: 16px;
  border-top: 1px solid var(--on-dark-line);
}

.safety h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.safety p {
  color: var(--on-dark-small);
}

@media (min-width: 760px) {
  .band-dark .section-head {
    margin-bottom: 48px;
  }

  .safety {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 48px;
  }

  .safety li {
    padding-top: 18px;
  }

  .safety p {
    font-size: 15.5px;
  }
}

@media (min-width: 1000px) {
  .safety {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- 6 Jak začít ---------- */

.steps {
  display: grid;
  gap: 28px;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.steps h3 {
  margin: 18px 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
  }

  .step-num {
    width: 44px;
    height: 44px;
  }

  .steps h3 {
    font-size: 19px;
  }
}

/* ---------- 7 Kontakt ---------- */

.contact-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.contact-card h2 {
  margin-bottom: 12px;
}

.contact-lead {
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-size: 17px;
}

.contact-name {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
}

.contact-line {
  margin-bottom: 6px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.contact-line + .button {
  margin-top: 26px;
}

.login-note {
  max-width: 760px;
  margin: 28px auto 0;
  color: var(--text-secondary);
  font-size: 15.5px;
  text-align: center;
}

@media (min-width: 760px) {
  .contact-card {
    padding: 44px 48px;
  }

  .contact-lead {
    font-size: 18px;
  }

  .contact-name {
    font-size: 19px;
  }

  .contact-line {
    font-size: 17px;
  }

  .login-note {
    margin-top: 36px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  background: var(--background);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.footer-inner,
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-sep {
  display: none;
  color: var(--border);
}

@media (min-width: 760px) {
  .site-footer {
    padding: 32px 0;
  }

  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px 32px;
  }

  .footer-meta {
    flex-direction: row;
    gap: 12px;
    align-items: baseline;
  }

  .footer-sep {
    display: inline;
  }
}

/* ---------- The small pages: pribeh.html, ochrana-udaju.html and 404.html ---------- */

.page-simple {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-simple main {
  flex: 1 0 auto;
}

.page-simple .site-footer {
  background: var(--surface);
}

.back-link {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
}

.prose h1 {
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.22;
}

.prose .intro {
  margin-bottom: 36px;
  font-size: 17px;
  line-height: 1.7;
}

.prose h2 {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 600;
}

.prose p {
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.prose .intro {
  color: var(--text);
}

.prose .back {
  margin: 12px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* pribeh.html: the story (a .prose article with a callout), "Kdo za ePlanDia stojí", the invitation. */
.story h2 {
  margin-top: 8px;
}

.prose.story > :last-child {
  margin-bottom: 0;
}

.story-callout {
  margin: 0 0 36px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
}

.prose .story-callout p {
  margin: 0;
  color: var(--text);
}

.story-cta {
  text-align: center;
}

.story-cta .section-lead {
  margin-bottom: 28px;
}

.story-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

@media (min-width: 760px) {
  .story-callout {
    padding: 24px 28px;
  }

  .story-cta-actions {
    flex-direction: row;
    justify-content: center;
    gap: 28px;
  }
}

.who-inner {
  display: grid;
  gap: 24px;
  max-width: 720px;
}

.who-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}

.who-text h2 {
  margin-bottom: 2px;
}

.who-role {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.who-text p:not(.eyebrow):not(.who-role) {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.who-text .who-link {
  margin-bottom: 0;
}

@media (min-width: 760px) {
  /* Photo beside the text only when there is one. */
  .who-inner:has(> .who-photo) {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }

  .who-inner {
    margin: 0 auto;
  }

  .who-photo {
    width: 136px;
    height: 136px;
  }
}

.error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px var(--gutter);
}

.error-inner {
  max-width: 560px;
  text-align: center;
}

.error h1 {
  margin-bottom: 16px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.22;
}

.error-text {
  margin-bottom: 32px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.hint-box {
  margin-top: 36px;
  padding: 18px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 15.5px;
}

@media (min-width: 760px) {
  .prose {
    padding: 64px var(--gutter) 80px;
  }

  .prose h1,
  .error h1 {
    font-size: 34px;
  }

  .prose h1 {
    margin-bottom: 24px;
  }

  .prose .intro {
    margin-bottom: 40px;
    font-size: 18px;
  }

  .prose p {
    margin-bottom: 32px;
  }

  .prose .back {
    padding-top: 32px;
  }

  .error {
    padding: 96px var(--gutter);
  }

  .error-text {
    font-size: 18px;
  }
}
