:root {
  color-scheme: light;
  --color-bg: #eafbff;
  --color-bg-soft: #f6feff;
  --color-bg-gradient-start: #f8feff;
  --color-bg-gradient-end: #ddf7fc;
  --color-card: #ffffff;
  --color-card-soft: rgba(255, 255, 255, 0.82);
  --color-primary: #0077c8;
  --color-primary-dark: #004e8a;
  --color-primary-soft: #ddf3ff;
  --color-teal: #1faeb7;
  --color-teal-soft: #ddfbff;
  --color-text: #071014;
  --color-muted: #7a8a92;
  --color-border: #dceff5;
  --color-danger: #ff3b30;
  --ink: var(--color-text);
  --muted: var(--color-muted);
  --surface: var(--color-card);
  --surface-soft: var(--color-bg-soft);
  --line: var(--color-border);
  --accent: var(--color-primary);
  --accent-dark: var(--color-primary-dark);
  --accent-soft: var(--color-primary-soft);
  --warn: #9f4f00;
  --warn-soft: #fff6e6;
  --shadow: 0 22px 60px rgba(0, 78, 138, 0.13);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(31, 174, 183, 0.2), transparent 34%),
    linear-gradient(180deg, var(--color-bg-gradient-start) 0%, var(--color-bg) 42%, var(--color-bg-gradient-end) 100%);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(248, 254, 255, 0.86);
  border-bottom: 1px solid rgba(220, 239, 245, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
}

.brand-text {
  display: grid;
  gap: 3px;
  line-height: 1.08;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 620;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(11, 28, 55, 0.14);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--accent);
}

.hero {
  position: relative;
  min-height: min(700px, calc(100vh - 32px));
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(248, 254, 255, 0.96) 0%, rgba(234, 251, 255, 0.8) 38%, rgba(221, 247, 252, 0.14) 100%),
    linear-gradient(0deg, rgba(234, 251, 255, 0.98) 0%, rgba(234, 251, 255, 0) 18%);
}

.hero-content {
  position: relative;
  width: min(760px, calc(100% - 36px));
  margin-left: clamp(18px, 7vw, 96px);
  padding: 92px 0 126px;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--color-teal);
  margin-bottom: 18px;
  font-size: 0.72rem;
  font-weight: 760;
  opacity: 0.92;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.55rem, 5.5vw, 4.45rem);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: normal;
  text-wrap: balance;
}

h1 span {
  display: block;
}

h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

.hero-copy {
  max-width: 62ch;
  margin: 28px 0 0;
  color: #33484f;
  font-size: 1.19rem;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 720;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover,
.doc-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(0, 119, 200, 0.24);
}

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

.button:disabled,
.icon-button:disabled,
.doc-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(220, 239, 245, 0.95);
  box-shadow: 0 12px 30px rgba(0, 78, 138, 0.1);
}

.compact {
  min-height: 38px;
  padding-inline: 14px;
  font-size: 0.9rem;
}

.generator-section,
.examples-section,
.footer {
  padding-inline: clamp(18px, 5vw, 64px);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: min(1180px, calc(100% - 36px));
  padding: 0;
  margin: -44px auto 0;
  position: relative;
  z-index: 2;
}

.trust-strip div {
  min-height: 118px;
  padding: 24px;
  border: 1px solid rgba(220, 239, 245, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(0, 78, 138, 0.08);
  backdrop-filter: blur(18px);
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.generator-section,
.examples-section {
  padding-top: 88px;
}

.section-heading {
  width: min(880px, 100%);
  margin: 0 auto 30px;
}

.section-heading p:not(.eyebrow) {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.document-panel,
.form-panel,
.output-panel,
.comparison article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(0, 78, 138, 0.08);
}

.document-panel,
.form-panel,
.output-panel {
  padding: 24px;
}

.doc-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.planned-docs {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.planned-docs summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
}

.planned-docs .doc-list {
  margin-top: 10px;
}

.doc-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px;
  color: var(--ink);
  background: var(--color-bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.doc-button.active {
  background: linear-gradient(135deg, var(--color-primary-soft), var(--color-teal-soft));
  border-color: rgba(0, 119, 200, 0.34);
  box-shadow: 0 10px 26px rgba(0, 119, 200, 0.11);
}

.doc-button.locked {
  color: #8a98a0;
  background: #f4fbfd;
  cursor: default;
}

.doc-button.locked:hover {
  transform: none;
}

.doc-label {
  font-weight: 720;
}

.doc-tag,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.76rem;
  font-weight: 760;
  white-space: nowrap;
}

.doc-button.locked .doc-tag {
  color: #6f838d;
  background: #e9f6fa;
}

.form-title,
.output-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.form-title h3,
.output-header h3 {
  margin-top: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--color-bg-soft);
  cursor: pointer;
  font-size: 1.25rem;
}

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

.le-fields,
.parent-fields,
.student-fields {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(246, 254, 255, 0.95), rgba(221, 251, 255, 0.44));
}

.form-panel.parent-mode .common-fields,
.form-panel.student-mode .common-fields {
  display: none;
}

.quick-form,
.advanced-stack,
.identity-fields {
  margin-top: 22px;
}

.quick-form:not(.le-grid) {
  display: grid;
  gap: 30px;
}

.parent-fields .quick-form > .le-grid {
  grid-template-columns: 1fr;
}

.preset-row,
.chip-group {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 14px;
}

.preset-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--color-bg-soft);
}

.chip-field {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.chip-field:last-child {
  margin-bottom: 0;
}

.chip-field > span {
  font-size: 0.9rem;
  font-weight: 760;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 540;
  line-height: 1.25;
}

.chip:hover {
  border-color: rgba(0, 119, 200, 0.38);
  box-shadow: 0 8px 18px rgba(0, 119, 200, 0.08);
}

.chip.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(0, 119, 200, 0.42);
}

.preset-chip {
  background: var(--color-teal-soft);
}

.state-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.advanced-stack {
  display: grid;
  gap: 12px;
}

.advanced-stack details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.advanced-stack summary {
  cursor: pointer;
  padding: 15px 16px;
  font-weight: 780;
}

.advanced-stack details[open] {
  background: var(--color-bg-soft);
}

.advanced-stack details > .le-grid {
  padding: 0 16px 18px;
}

.conditional-field[hidden] {
  display: none;
}

.le-fields[hidden],
.parent-fields[hidden],
.student-fields[hidden] {
  display: none;
}

.subsection-heading {
  margin-bottom: 18px;
}

.subsection-heading h4 {
  margin: 0;
  font-size: 1rem;
}

.subsection-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

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

.le-wide {
  grid-column: 1 / -1;
}

.field-group {
  padding-top: 20px;
  border-top: 1px solid rgba(220, 239, 245, 0.9);
}

.field-group:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.field-group + .field-group {
  margin-top: 24px;
}

.field-group h5,
fieldset legend {
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 780;
}

.required-mark {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 760;
}

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

fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--color-bg-soft);
}

.check-option {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  margin-top: 11px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
}

.check-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.compact-fields {
  margin-top: 18px;
}

label {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
  font-weight: 500;
  line-height: 1.45;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.13);
}

.form-panel > label,
.privacy-check {
  margin-top: 20px;
}

.privacy-check {
  padding: 16px;
  border: 1px solid rgba(31, 174, 183, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-teal-soft), #ffffff);
}

.checkbox-row {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.privacy-check p {
  margin: 9px 0 0;
  color: #52666f;
  font-size: 0.88rem;
  line-height: 1.45;
}

.generate-button {
  width: 100%;
  margin-top: 14px;
}

.output-panel {
  position: static;
}

.output-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  min-height: 520px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: linear-gradient(180deg, var(--color-bg-soft), rgba(221, 243, 255, 0.5));
  text-align: center;
  line-height: 1.6;
}

.output-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 520px;
  padding: 28px;
  border: 1px solid rgba(220, 239, 245, 0.95);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(31, 174, 183, 0.15), transparent 34%),
    linear-gradient(180deg, var(--color-bg-soft), rgba(221, 243, 255, 0.6));
  color: var(--ink);
  text-align: center;
}

.output-loading p {
  margin: 0;
  font-weight: 780;
}

.output-loading small {
  color: var(--muted);
  font-size: 0.9rem;
}

.loading-orbit {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(220, 239, 245, 0.95), 0 18px 40px rgba(0, 78, 138, 0.12);
}

.loading-orbit::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  border: 3px solid var(--color-primary-soft);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.loading-orbit span {
  position: absolute;
  top: 28px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-teal);
  animation: pulse 1s ease-in-out infinite;
}

.loading-orbit span:nth-child(1) {
  left: 20px;
}

.loading-orbit span:nth-child(2) {
  left: 29px;
  animation-delay: 0.14s;
}

.loading-orbit span:nth-child(3) {
  left: 38px;
  animation-delay: 0.28s;
}

.result-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.result-hints span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 740;
}

.is-hidden {
  display: none;
}

#promptOutput {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  animation: outputIn 0.22s ease-out;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@keyframes outputIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.copy-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.comparison article {
  padding: 24px;
}

.comparison p,
.footer p {
  color: var(--muted);
  line-height: 1.65;
}

.legal-main {
  padding: 82px clamp(18px, 5vw, 64px) 42px;
}

.legal-hero {
  width: min(920px, calc(100vw - 48px));
  margin: 0 auto 26px;
  min-width: 0;
}

.legal-hero h1 {
  max-width: 12ch;
}

.legal-hero p:not(.eyebrow) {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.legal-card {
  width: min(920px, calc(100vw - 48px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 42px rgba(0, 78, 138, 0.08);
  overflow: hidden;
}

.legal-card section + section {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid rgba(220, 239, 245, 0.95);
}

.legal-card h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.legal-card h3 {
  margin-top: 18px;
}

.legal-card p,
.legal-card li {
  color: #33484f;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.legal-card ul {
  padding-left: 1.2rem;
}

.placeholder,
.legal-note {
  border-radius: 8px;
  background: var(--color-primary-soft);
}

.placeholder {
  display: inline;
  max-width: 100%;
  padding: 0 6px;
  color: var(--accent-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
  white-space: normal;
}

.legal-note {
  padding: 14px 16px;
  color: #33484f;
}

.footer {
  padding-top: 70px;
  padding-bottom: 34px;
  text-align: center;
}

.footer p {
  max-width: 760px;
  margin: 0 auto;
}

.footer .credit {
  margin-top: 10px;
  color: #6f838d;
  font-size: 0.9rem;
}

.footer a {
  color: var(--accent-dark);
  font-weight: 700;
}

.footer a:hover {
  color: var(--accent);
}

@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .brand-text small {
    font-size: 0.72rem;
  }

  .hero {
    min-height: 680px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(248, 254, 255, 0.96), rgba(234, 251, 255, 0.76)),
      linear-gradient(0deg, rgba(234, 251, 255, 0.98) 0%, rgba(234, 251, 255, 0) 20%);
  }

  .hero-content {
    padding-top: 72px;
    padding-bottom: 112px;
  }

  .hero .eyebrow {
    max-width: 26ch;
    line-height: 1.35;
  }

  .hero-copy {
    max-width: 30ch;
    font-size: 1.05rem;
  }

  h1 {
    max-width: 15ch;
    font-size: clamp(2.05rem, 9vw, 2.45rem);
    line-height: 1.05;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .trust-strip,
  .comparison,
  .le-grid,
  .multi-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .le-wide {
    grid-column: auto;
  }

  .trust-strip {
    gap: 12px;
    margin-top: -38px;
  }

  .trust-strip span {
    max-width: 30ch;
    overflow-wrap: anywhere;
  }

  .legal-main {
    width: 100%;
    padding: 68px 24px 34px;
  }

  .legal-hero,
  .legal-card {
    width: min(100%, calc(100vw - 48px));
    max-width: 100%;
  }

  .legal-hero h1 {
    max-width: 100%;
    font-size: clamp(2.2rem, 12vw, 2.7rem);
  }

  .legal-hero p:not(.eyebrow),
  .legal-card p,
  .legal-card li {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .legal-card {
    padding: 22px;
  }

  .legal-card h2 {
    font-size: 1.45rem;
  }
}
