:root {
  --blue: #07529a;
  --blue-dark: #07396c;
  --blue-soft: #eaf4ff;
  --red: #c62f42;
  --ink: #132238;
  --muted: #637083;
  --line: #dce4ee;
  --surface: #ffffff;
  --background: #f4f7fb;
  --success: #157347;
  --warning: #a15c00;
  --danger: #b42334;
  --shadow: 0 18px 50px rgba(21, 49, 83, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--ink); }
body, button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-size: 1rem; }
button, .button { cursor: pointer; }

.container { width: min(1160px, calc(100% - 2rem)); margin-inline: auto; }
.topbar { background: var(--blue-dark); color: #fff; font-size: .9rem; }
.topbar .container { display: flex; justify-content: space-between; gap: 1rem; padding-block: .65rem; }
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.navbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--blue-dark); flex: 0 0 auto; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand-copy { display: grid; gap: .22rem; line-height: 1; }
.brand-copy strong { display: block; font-size: 1.02rem; font-weight: 850; letter-spacing: -.015em; white-space: nowrap; }
.brand-copy small { display: block; color: var(--red); font-size: .68rem; font-weight: 850; line-height: 1.15; letter-spacing: .16em; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 1.35rem; font-weight: 650; }
.nav-links a:hover, .nav-links a.active { color: var(--blue); }
.menu-toggle { display: none; border: 1px solid var(--line); background: white; border-radius: .65rem; padding: .65rem; }

.hero { background: linear-gradient(128deg, #062f5c 0%, #075ba8 62%, #0e75ba 100%); color: white; overflow: hidden; }
.hero-grid { min-height: 520px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 3rem; padding-block: 5rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; color: #bfe1ff; font-size: .82rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 5.3rem); line-height: .98; margin: 1rem 0 1.25rem; letter-spacing: -.045em; }
.hero p { max-width: 680px; font-size: 1.08rem; line-height: 1.75; color: #e3f1ff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero-logo { justify-self: center; width: min(370px, 80vw); filter: drop-shadow(0 28px 35px rgba(0,0,0,.24)); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .7rem 1rem; border: 1px solid transparent; border-radius: .7rem; background: var(--blue); color: white; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); background: var(--blue-dark); }
.button.secondary { background: white; color: var(--blue-dark); border-color: var(--line); }
.button.secondary:hover { background: var(--blue-soft); }
.button.ghost { background: transparent; color: var(--blue); border-color: #bad6ef; }
.button.danger { background: var(--danger); }
.button.small { min-height: 36px; padding: .46rem .72rem; font-size: .9rem; }
.button.block { width: 100%; }

.section { padding-block: 4.5rem; }
.section.compact { padding-block: 2.4rem; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.6rem; }
.section-head h1, .section-head h2 { margin: .25rem 0 0; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.03em; }
.section-head p { margin: .5rem 0 0; color: var(--muted); line-height: 1.7; }
.grid { display: grid; gap: 1.25rem; }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1.35rem; box-shadow: 0 6px 22px rgba(21,49,83,.04); }
.card h2, .card h3 { margin: .35rem 0 .65rem; }
.card p { color: var(--muted); line-height: 1.65; }
.card-link { transition: .18s ease; }
.card-link:hover { border-color: #8fbce4; transform: translateY(-2px); box-shadow: var(--shadow); }
.badge { display: inline-flex; border-radius: 999px; padding: .28rem .58rem; background: var(--blue-soft); color: var(--blue-dark); font-size: .78rem; font-weight: 800; }
.badge.draft { background: #fff4d6; color: #805500; }
.badge.archived { background: #eceff3; color: #4c5666; }
.meta { display: flex; flex-wrap: wrap; gap: .65rem; color: var(--muted); font-size: .88rem; }
.prose { max-width: 820px; white-space: pre-line; font-size: 1.05rem; line-height: 1.85; color: #344154; }
.empty { padding: 3rem; text-align: center; border: 1px dashed #b7c5d5; border-radius: 1rem; background: white; color: var(--muted); }
.media-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.media-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: .8rem; background: #e9eef4; }

.filter-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.25rem; }
.filter { border: 1px solid var(--line); background: white; border-radius: 999px; padding: .55rem .85rem; color: var(--muted); }
.filter:hover, .filter.active { color: white; background: var(--blue); border-color: var(--blue); }

.site-footer { margin-top: 4rem; background: #071f39; color: #d7e3ef; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .7fr .8fr; gap: 2.4rem; padding-block: 3rem; }
.footer-grid h3 { margin-top: 0; color: white; }
.footer-grid p, .footer-grid a { color: #b8c9d9; line-height: 1.7; }
.footer-links { display: grid; gap: .65rem; }
.copyright { border-top: 1px solid rgba(255,255,255,.12); padding: 1rem 0; font-size: .88rem; color: #9cb1c5; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: radial-gradient(circle at top right,#cde8ff,transparent 38%), var(--background); }
.auth-card { width: min(480px,100%); background: white; border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: var(--shadow); padding: 2rem; }
.auth-card .brand { margin-bottom: 1.5rem; }
.auth-card h1 { margin-bottom: .5rem; }
.auth-card > p { color: var(--muted); line-height: 1.6; }

.field { display: grid; gap: .42rem; margin-bottom: 1rem; }
.field label, .field-label { font-size: .92rem; font-weight: 750; }
.field small { color: var(--muted); line-height: 1.5; }
input, textarea, select { width: 100%; border: 1px solid #cbd6e2; border-radius: .65rem; padding: .72rem .8rem; background: white; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: #4b95d0; box-shadow: 0 0 0 3px rgba(75,149,208,.15); }
textarea { min-height: 120px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.check-row { display: flex; align-items: center; gap: .55rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 1rem; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .7rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.alert { margin-bottom: 1rem; border-radius: .72rem; padding: .85rem 1rem; border: 1px solid; }
.alert.success { color: var(--success); background: #ebfff5; border-color: #a8e5c7; }
.alert.error { color: var(--danger); background: #fff0f2; border-color: #f1b4bd; }
.alert.info { color: var(--blue-dark); background: var(--blue-soft); border-color: #b7d9f5; }

.admin-body { background: #eef3f8; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0,1fr); }
.admin-sidebar { background: #071f39; color: white; padding: 1.2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .brand { color: white; }
.admin-sidebar nav { display: grid; gap: .35rem; margin-top: 2rem; }
.admin-sidebar nav a { display: flex; padding: .72rem .8rem; border-radius: .65rem; color: #bed0e1; font-weight: 650; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,.11); color: white; }
.admin-sidebar .sidebar-bottom { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.14); }
.admin-main { min-width: 0; }
.admin-top { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-inline: 2rem; background: white; border-bottom: 1px solid var(--line); }
.admin-content { padding: 2rem; width: min(1300px,100%); }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat strong { display: block; font-size: 2rem; margin-top: .45rem; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); background: #f8fafc; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.inline-form { display: inline; }

.question-builder { display: grid; gap: 1rem; }
.question-card { border: 1px solid var(--line); background: #f8fafc; border-radius: .85rem; padding: 1rem; }
.question-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.question-controls { display: flex; gap: .35rem; }
.question-options { display: grid; gap: .45rem; margin-top: .75rem; }
.question-option { display: grid; grid-template-columns: 1fr auto; gap: .45rem; }
.survey-question { margin-bottom: 1rem; }
.survey-question fieldset { border: 0; padding: 0; margin: 0; }
.survey-question legend { width: 100%; font-weight: 800; margin-bottom: .45rem; }
.choice-list { display: grid; gap: .55rem; }
.choice { display: flex; align-items: center; gap: .6rem; padding: .7rem; border: 1px solid var(--line); border-radius: .65rem; }
.rating { display: flex; flex-wrap: wrap; gap: .55rem; }
.rating label { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: .65rem; background: white; }
.result-bar { height: 10px; background: #e7edf4; border-radius: 999px; overflow: hidden; }
.result-bar span { display: block; height: 100%; background: var(--blue); }
.result-row { display: grid; grid-template-columns: minmax(130px,.8fr) 2fr 58px; gap: .7rem; align-items: center; margin-top: .55rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; padding-block: 3.5rem; }
  .hero p { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-logo { width: 230px; order: -1; }
  .grid.three, .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .admin-sidebar nav { grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 1rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .topbar .container { display: block; }
  .menu-toggle { display: inline-flex; }
  .navbar { min-height: 74px; }
  .brand { gap: .65rem; }
  .brand img { width: 47px; height: 47px; }
  .brand-copy strong { font-size: .94rem; }
  .brand-copy small { font-size: .61rem; letter-spacing: .13em; }
  .nav-links { display: none; position: absolute; inset: 78px 0 auto; padding: 1rem; background: white; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; }
  .nav-links.open { display: flex; }
  .grid.three, .grid.two, .media-grid, .footer-grid, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .section { padding-block: 3rem; }
  .admin-sidebar nav { grid-template-columns: 1fr 1fr; }
  .admin-top, .admin-content { padding-inline: 1rem; }
  .section-head { align-items: stretch; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .result-row { grid-template-columns: 1fr; }
}
