:root {
  --bg: #f4f8f5;
  --surface: #ffffff;
  --surface-alt: #eef5f0;
  --primary: #2f855a;
  --primary-hover: #276749;
  --primary-strong: #1e5a3c;
  --primary-soft: #ddeee4;
  --secondary: #5e7c6a;
  --text: #183024;
  --text-soft: #41584b;
  --border: #d5e2d8;
  --border-strong: #aac7b4;
  --success: #2e8b57;
  --warning: #c28a2e;
  --danger: #b24a4a;
  --shadow: 0 10px 26px rgba(24, 48, 36, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Marianne, "Source Sans 3", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(1200px 450px at 98% -15%, rgba(47, 133, 90, 0.16), transparent 62%),
    radial-gradient(1000px 380px at -12% 0%, rgba(94, 124, 106, 0.12), transparent 58%),
    var(--bg);
}

.hero {
  padding: 1.6rem 1rem 0.8rem;
}

.hero__inner,
.layout,
.footer {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
}

.hero-card {
  background: linear-gradient(165deg, #f8fcfa 0%, #edf5f0 100%);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.8fr 1fr;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

h1 {
  margin: 0.35rem 0 0.35rem;
  font-size: clamp(2rem, 2.9vw, 3rem);
  line-height: 1.05;
  color: var(--text);
}

.subtitle {
  margin: 0 0 0.85rem;
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 60ch;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #a8cdb7;
  background: #eef7f1;
  color: var(--primary-strong);
  border-radius: 999px;
  padding: 0.28rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero__trust {
  background: #fbfffc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
}

.hero__trust h2 {
  margin: 0 0 0.5rem;
  font-size: 0.96rem;
  color: #245e45;
}

.hero__trust ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  display: grid;
  gap: 0.35rem;
}

.layout {
  margin-bottom: 1rem;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 961px) {
  .app-grid {
    grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr);
    align-items: start;
  }

  .app-grid > section[aria-labelledby="source-title"] {
    grid-column: 1;
    grid-row: 1;
  }

  .app-grid > section[aria-labelledby="result-title"] {
    grid-column: 1;
    grid-row: 2;
  }

  .app-grid > section[aria-labelledby="detection-title"] {
    grid-column: 2;
    grid-row: 1;
  }

  .app-grid > .safety-card {
    grid-column: 2;
    grid-row: 2;
  }
}

.card {
  background: var(--surface);
  border: 1px solid #c9dcd0;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(30, 60, 40, 0.06);
  padding: 1rem;
}

.step-card {
  position: relative;
}

.section-title-wrap {
  margin-bottom: 0.72rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  margin: 0;
  color: #11261b;
  font-size: 1.08rem;
  font-weight: 850;
}

.section-title--small {
  font-size: 1rem;
}

.section-help {
  margin: 0.4rem 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.step-badge {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border: 1px solid #b5d4c2;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

label,
.label-like {
  display: block;
  margin: 0 0 0.36rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1f3b2e;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fcfefc;
  color: var(--text);
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.45;
  padding: 0.82rem 0.9rem;
}

textarea {
  min-height: 210px;
  resize: vertical;
}

#student-names {
  min-height: 145px;
}

#result-text {
  background: #f7fcf8;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(47, 133, 90, 0.16);
}

.gender-toggle {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gender-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: #214033;
  border-radius: 10px;
  padding: 0.55rem 0.72rem;
  font-size: 0.93rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}

.gender-pill:hover {
  border-color: #8ab89d;
  background: #f5fbf7;
}

.gender-pill.is-active {
  border-color: var(--primary);
  background: #dcefe4;
  color: var(--primary-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.anonymization-actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
}

.btn {
  border-radius: 11px;
  padding: 0.58rem 0.9rem;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background-color 0.17s ease, border-color 0.17s ease, transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--primary) 0%, #2a724f 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(47, 133, 90, 0.22);
}

.btn--primary:hover {
  background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary-strong) 100%);
}

.btn--secondary {
  background: #fff;
  color: #1f5d42;
  border-color: #bcd8c7;
}

.btn--secondary:hover {
  border-color: #90ba9f;
  background: #f5fbf7;
}

.btn--large {
  padding: 0.73rem 1.05rem;
}

.hint {
  margin: 0.5rem 0 0;
  color: #3f5649;
  font-size: 0.86rem;
}

.stats {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.stat-chip {
  border: 1px solid #b9d6c4;
  background: #edf8f1;
  color: #1f5f42;
  border-radius: 999px;
  padding: 0.26rem 0.66rem;
  font-size: 0.81rem;
  font-weight: 800;
}

.safety-card {
  background: linear-gradient(180deg, #fbfefc 0%, #f2f8f4 100%);
}

.safety-list {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.45rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.footer {
  color: var(--text-soft);
  font-size: 0.84rem;
  padding: 0 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 960px) {
  .hero-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 1rem;
  }

  .hero__inner,
  .layout,
  .footer {
    width: min(1180px, 100% - 1rem);
  }

  .card {
    padding: 0.85rem;
  }

  .card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .anonymization-actions {
    justify-content: stretch;
  }

  .btn--large {
    width: 100%;
  }
}
