:root {
  --ink: #1c2b33;
  --muted: #5a6d78;
  --brand: #0f7f85;
  --brand-deep: #0a5c61;
  --accent: #f07a45;
  --accent-soft: #ffe4d6;
  --sky: #e8f6f7;
  --mint: #d4efe8;
  --paper: #fffdf9;
  --line: rgba(28, 43, 51, 0.1);
  --ok: #1f8a5b;
  --warn: #b7791f;
  --err: #c0392b;
  --shadow: 0 18px 50px rgba(15, 92, 97, 0.12);
  --radius: 22px;
  --font-display: "Fredoka", sans-serif;
  --font-body: "Nunito", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #c8ecee 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ffe0cc 0%, transparent 50%),
    linear-gradient(180deg, #f3fbfb 0%, #fff9f4 45%, #f7faf8 100%);
  min-height: 100vh;
  line-height: 1.55;
}

a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--accent); }

.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.narrow { width: min(720px, calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  padding: 1.1rem 0;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(255, 253, 249, 0.78);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand), #2bb3a8);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  box-shadow: 0 8px 20px rgba(15, 127, 133, 0.28);
}
.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-text span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}
.nav-links { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #1aa39a);
  color: white;
  box-shadow: 0 10px 24px rgba(15, 127, 133, 0.28);
}
.btn-primary:hover { color: white; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #ff9a63);
  color: white;
  box-shadow: 0 10px 24px rgba(240, 122, 69, 0.28);
}
.btn-accent:hover { color: white; }
.btn-ghost {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-danger {
  background: #fde8e6;
  color: var(--err);
}
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.9rem; }

.hero {
  padding: 4.5rem 0 3.5rem;
  min-height: calc(100vh - 78px);
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 8% -10% auto auto;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), transparent 45%),
    linear-gradient(160deg, #7fd3cf 0%, #f7b489 100%);
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  opacity: 0.55;
  animation: floatBlob 10s ease-in-out infinite;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; max-width: 640px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 34rem;
  margin: 0 0 1.6rem;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

body.page-login {
  background: #0b1a1f !important;
  min-height: 100vh;
  overflow-x: hidden;
}
body.page-login .flash-wrap {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  z-index: 30;
}
.hero-login {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 1.5rem;
  overflow: hidden;
  background: #0b1a1f;
}
.hero-login::before,
.hero-login::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}
.login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    #0b1a1f url("../img/okul_resmi.jpg") center center / contain no-repeat;
}
.login-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}
.login-hero {
  position: relative;
  z-index: 2;
  width: min(480px, 100%);
  padding: 0.85rem 0.75rem;
  border-radius: 24px;
  background: rgba(8, 22, 28, 0.28);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.login-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
  color: #fffdf9 !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.login-hero > p {
  font-size: 1.05rem;
  margin: 0 0 1.2rem;
  color: rgba(255, 253, 249, 0.92) !important;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
.login-card {
  margin-top: 0.4rem;
  padding: 1.35rem 1.4rem;
  animation: riseIn 0.55s ease both;
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(10px);
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatBlob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(18px) rotate(8deg); }
}

.panel {
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.page { padding: 2rem 0 3.5rem; }
.page h1, .page h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
}
.page .lead { color: var(--muted); margin: 0 0 1.5rem; }

.flash-wrap { width: min(1120px, calc(100% - 2rem)); margin: 1rem auto 0; }
.flash {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  margin-bottom: 0.6rem;
  font-weight: 700;
}
.flash.success { background: #e7f7ef; color: var(--ok); }
.flash.warning { background: #fff4df; color: var(--warn); }
.flash.error { background: #fdecea; color: var(--err); }

.form-grid { display: grid; gap: 1rem; }
label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  font: inherit;
  background: white;
  color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(15, 127, 133, 0.35);
  border-color: var(--brand);
}

.survey-list { display: grid; gap: 1rem; }
.survey-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(232,246,247,0.9), rgba(255,255,255,0.95));
  border: 1px solid var(--line);
}
.survey-item h3 { margin: 0 0 0.25rem; font-family: var(--font-display); font-size: 1.2rem; }
.survey-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}
.badge.ok { background: #e7f7ef; color: var(--ok); }
.badge.wait { background: var(--accent-soft); color: #b24f22; }
.badge.off { background: #eee; color: #666; }

.section-title {
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(15, 127, 133, 0.18);
  font-family: var(--font-display);
  color: var(--brand-deep);
  font-size: 1.25rem;
}
.question {
  margin-bottom: 1.35rem;
  padding: 1.1rem 1.15rem;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}
.question .q-num {
  color: var(--brand);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.question .q-text { margin: 0.35rem 0 0.85rem; font-weight: 700; }
.choices { display: grid; gap: 0.55rem; }
.choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: var(--sky);
  font-weight: 600;
  cursor: pointer;
}
.choice:hover { background: var(--mint); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem;
}
.stat-card .n {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--brand-deep);
  line-height: 1;
}
.stat-card .l { color: var(--muted); font-size: 0.9rem; margin-top: 0.35rem; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
th {
  background: var(--sky);
  font-weight: 800;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }

.bar-row { margin: 0.55rem 0; }
.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #eef3f4;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #3ec4b5);
  transition: width .6s ease;
}

.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0 3rem;
}
.admin-nav {
  background: rgba(255,253,249,0.95);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  height: fit-content;
  position: sticky;
  top: 90px;
}
.admin-nav a {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.admin-nav a:hover,
.admin-nav a.active {
  background: var(--sky);
  color: var(--brand-deep);
}
.admin-nav .nav-title {
  font-family: var(--font-display);
  margin: 0.2rem 0 0.8rem;
  font-size: 1.05rem;
}

.q-builder { display: grid; gap: 1rem; }
.q-builder-item {
  border: 1px dashed rgba(15,127,133,0.35);
  border-radius: 16px;
  padding: 1rem;
  background: #fbfffe;
  display: grid;
  gap: 0.75rem;
}
.inline-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.muted { color: var(--muted); }
.footer {
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; gap: 0.35rem; }
  .admin-nav a { margin: 0; }
  .survey-item { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .stats-grid, .inline-2 { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; min-height: auto; }
  .hero-login {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.25rem;
  }
}
