:root {
  color-scheme: light;
  --bg-page: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-surface-soft: #f9f9fb;
  --border-subtle: rgba(15, 15, 20, 0.08);
  --border-strong: rgba(15, 15, 20, 0.14);
  --text-main: #111111;
  --text-muted: #4c4c58;
  --text-soft: #8b8b96;

  --red: #e63746;
  --red-soft: #fbd3da;

  --yellow: #f5a623;
  --yellow-soft: #ffe7ba;

  --green: #1f9d6a;
  --green-soft: #cff0df;

  --radius-large: 32px;
  --radius-medium: 20px;

  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.12);
  --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.06);

  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

/* reset */

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

html,
body {
  margin: 0;
  padding: 0;
}

/* base */

body {
  font-family: var(--font-system);
  background: radial-gradient(circle at top, #ffffff, var(--bg-page));
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  font-size: 16px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* password */

.auth-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-radius: 40px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 36px 32px 30px;
  max-width: 420px;
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  margin: 0 auto 10px;
  background:
    radial-gradient(circle at 25% 25%, #ffffff, transparent 55%),
    conic-gradient(from 220deg, var(--red) 0deg, var(--yellow) 120deg, var(--green) 240deg, var(--red) 360deg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.auth-title {
  font-size: 24px;
  margin: 0;
}

.auth-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-label {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-input {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  font-size: 15px;
  background: rgba(248, 248, 252, 0.96);
  outline: none;
}

.auth-input:focus {
  border-color: rgba(0, 122, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
  background: #ffffff;
}

.auth-button {
  margin-top: 4px;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #007aff, #0051d8);
  box-shadow: 0 10px 22px rgba(0, 122, 255, 0.35);
  cursor: pointer;
}

.auth-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}

.auth-error {
  min-height: 16px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--red);
}

.auth-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.main-content {
  display: none;
}

body.unlocked .auth-screen {
  display: none;
}

body.unlocked .main-content {
  display: block;
  width: 100%;
}

/* header */

.site-header {
  padding: 20px 16px 8px;
}

.site-header-inner {
  max-width: 980px;
  margin: 0 auto;
}

.site-id {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.site-mark {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 25% 25%, #ffffff, transparent 55%),
    conic-gradient(from 220deg, var(--red) 0deg, var(--yellow) 120deg, var(--green) 240deg, var(--red) 360deg);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.site-title {
  margin: 0;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* layout */

.site-body {
  padding: 12px 16px 40px;
}

.site-layout {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* hero light */

/* hero layout */

.hero {
  margin-top: 18px;
}

.hero-inner {
  border-radius: var(--radius-large);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.95);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1.5fr);
  gap: 24px;
  align-items: center;
}

.hero-light {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-tagline {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

.hero-legend {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-legend-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-legend-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-legend-red {
  color: var(--red);
}

.hero-legend-yellow {
  color: var(--yellow);
}

.hero-legend-green {
  color: var(--green);
}

.hero-legend-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.hero-note {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-note p {
  margin: 0 0 6px;
}

.hero-note p:last-child {
  margin-bottom: 0;
}


.traffic-column {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.traffic-pillar {
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.traffic-light {
  width: 220px;
  max-width: 100%;
  padding: 20px 22px;
  border-radius: 42px;
  background: radial-gradient(circle at 10% 0, #474965, #20212e);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
}


.traffic-lens {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.45),
    0 10px 30px rgba(0, 0, 0, 0.7);
}

.traffic-lens::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: inherit;
  background: radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.9), transparent 55%);
}

.traffic-lens span {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.6);
}

.traffic-lens-red {
  background: radial-gradient(circle at 30% 0, #ffe4ea, #e63746 25%, #5c050f 80%);
}

.traffic-lens-yellow {
  background: radial-gradient(circle at 30% 0, #fff2cd, #f5a623 25%, #8a4f00 80%);
}

.traffic-lens-green {
  background: radial-gradient(circle at 30% 0, #ddf7f0, #1f9d6a 25%, #00462c 80%);
}

/* zones and cards */

.zones-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.zone {
  border-radius: var(--radius-large);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.zone-intro {
  background: var(--bg-surface-soft);
}

.zone-red {
  background: linear-gradient(145deg, #ffffff, var(--red-soft));
}

.zone-yellow {
  background: linear-gradient(145deg, #ffffff, var(--yellow-soft));
}

.zone-green {
  background: linear-gradient(145deg, #ffffff, var(--green-soft));
}

.zone-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.zone-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zone-title {
  margin: 0;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.zone-tagline {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.zone-summary {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.zone-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 15, 20, 0.12);
}

.zone-dot-red {
  background: radial-gradient(circle at 25% 20%, #ffe4ea, var(--red));
}

.zone-dot-yellow {
  background: radial-gradient(circle at 25% 20%, #fff2cd, var(--yellow));
}

.zone-dot-green {
  background: radial-gradient(circle at 25% 20%, #ddf7f0, var(--green));
}

/* rules */

.rule {
  border-radius: var(--radius-medium);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.96);
  margin-top: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.rule-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}

.rule-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

.rule-text + .rule-text {
  margin-top: 10px;
}

/* responsive */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-light {
    order: 1;
  }

  .hero-copy {
    order: 2;
  }

  .zone {
    border-radius: 26px;
  }
}


@media (max-width: 640px) {
  .site-title {
    font-size: 20px;
  }

  .site-id {
    width: 100%;
    justify-content: space-between;
  }

  .site-body {
    padding-inline: 12px;
  }

  .zone {
    padding-inline: 16px;
  }

  .rule {
    padding-inline: 12px;
  }
}

/* print */

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

  .auth-screen {
    display: none !important;
  }

  .main-content {
    display: block !important;
  }

  .site-body {
    padding: 0;
  }

  .site-layout {
    max-width: none;
    display: block;
  }

  .traffic-column {
    display: none;
  }

  .zone-intro,
  .zone {
    box-shadow: none;
    border-radius: 0;
    background: #ffffff;
    border: 1px solid #cccccc;
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 14px 12px;
  }

  .rule {
    box-shadow: none;
    background: #ffffff;
    border: 1px solid #dddddd;
  }

  .rule-title {
    font-size: 15px;
  }

  .rule-text {
    font-size: 13px;
  }

  @page {
    size: A4;
    margin: 18mm 16mm;
  }
}
