/* Jr. Seed Sowers Student Application — multi-step wizard
   Brand aligned with ossoa.net (deep purple + gold accents) */

@import url("https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700&family=Noto+Serif:ital,wght@0,400;0,600;1,400&family=Poppins:wght@600;700;800;900&display=swap");

:root {
  --page-bg: #f7f4fb;
  --page-bg-deep: #efe8f7;
  --surface: #ffffff;
  --brand-purple: #680092;
  --brand-deep: #430863;
  --brand-bright: #aa45fc;
  --gold: #fcbc45;
  --gold-deep: #fd9e01;
  --text: #252425;
  --text-muted: #6f747e;
  --border: #e2d6ef;
  --border-strong: #c9b4e0;
  --field-bg: #fbf9f5;
  --field-line: #d0c4dc;
  --danger: #b42318;
  --ok: #067647;
  --on-purple: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 36px rgba(67, 8, 99, 0.08);
  --font: "Heebo", "Segoe UI", sans-serif;
  --font-display: "Poppins", "Heebo", sans-serif;
  --font-serif: "Noto Serif", Georgia, serif;
  --max: 720px;
  --header-max: 880px;
}

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

html {
  scroll-behavior: smooth;
}

body.application-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(170, 69, 252, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at -10% 20%, rgba(67, 8, 99, 0.1), transparent 50%),
    linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-deep) 100%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-deep);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Top bar —— */
.app-topbar {
  max-width: var(--header-max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem 0;
}

.home-link {
  color: var(--brand-purple);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.home-link:hover,
.home-link:focus-visible {
  text-decoration: underline;
  color: var(--brand-deep);
}

/* —— Header —— */
.app-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2.5rem;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0.5rem 0 1.5rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-purple) 72%, #7a12a8 100%);
  border-radius: var(--radius);
  color: var(--on-purple);
  box-shadow: var(--shadow);
}

.app-header__logo {
  width: 200px;
  height: auto;
  aspect-ratio: 1220 / 730;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.app-header__copy {
  min-width: 0;
}

.app-header__eyebrow {
  margin: 0;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.app-header__title {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.app-header__subtitle {
  margin: 0.15rem 0 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.app-header__mission {
  margin: 0.65rem 0 0;
  font-size: 0.84rem;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  max-width: 36rem;
}

/* —— Progress —— */
.wizard-progress {
  margin-bottom: 1.15rem;
}

.wizard-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.wizard-progress__step-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-purple);
}

.wizard-progress__section-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.wizard-progress__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(104, 0, 146, 0.12);
  overflow: hidden;
}

.wizard-progress__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-bright));
  transition: width 0.35s ease;
}

.wizard-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
}

.wizard-steps li {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(104, 0, 146, 0.14);
  color: transparent;
  font-size: 0;
  transition: background 0.25s ease;
}

.wizard-steps li.is-done {
  background: var(--brand-purple);
}

.wizard-steps li.is-active {
  background: var(--gold);
}

/* —— Panels —— */
.application-form.wizard {
  display: block;
}

.wizard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.35rem 1.15rem;
  animation: panelIn 0.28s ease;
}

.wizard-panel[hidden] {
  display: none !important;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-panel {
    animation: none;
  }

  .wizard-progress__fill,
  .wizard-steps li {
    transition: none;
  }
}

.wizard-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
}

.wizard-panel__lead {
  margin: 0.35rem 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.wizard-panel__body {
  display: block;
}

.form-disclaimer,
.form-note {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: rgba(104, 0, 146, 0.06);
  border-left: 3px solid var(--brand-purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-agree-label {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  color: var(--brand-deep);
}

.form-agree-label strong {
  font-weight: 700;
}

/* —— Fields —— */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

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

.field label,
.checkbox-group > legend {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field textarea {
  width: 100%;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-purple);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(104, 0, 146, 0.15);
}

.field input[readonly] {
  background: rgba(104, 0, 146, 0.06);
  color: var(--text-muted);
  cursor: default;
}

.field-hint {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.field input.is-invalid,
.field textarea.is-invalid,
.checkbox-group.is-invalid,
.signature-pad-frame.is-invalid {
  border-color: var(--danger) !important;
}

.field-error {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.field-row > .field,
.field-row > .checkbox-group {
  margin-bottom: 0;
}

.field--full { flex: 1 1 100%; width: 100%; }
.field--half { flex: 1 1 calc(50% - 0.4rem); min-width: 120px; }
.field--third { flex: 1 1 calc(33.333% - 0.5rem); min-width: 90px; }
.field--two-thirds { flex: 1 1 calc(66.666% - 0.4rem); min-width: 140px; }
.field--quarter { flex: 1 1 calc(25% - 0.6rem); min-width: 70px; }

/* —— Choices —— */
.checkbox-group {
  border: 0;
  padding: 0;
  margin: 0 0 0.9rem;
  min-width: 0;
}

.checkbox-group > legend {
  padding: 0;
  margin-bottom: 0.45rem;
}

.checkbox-group__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}

.checkbox-group__options--stacked {
  flex-direction: column;
  gap: 0.55rem;
}

.checkbox-group__options--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
}

.choice {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.checkbox-group__options--stacked .choice {
  width: 100%;
}

.choice:hover {
  border-color: var(--border-strong);
  background: rgba(104, 0, 146, 0.03);
}

.choice:has(input:checked) {
  border-color: var(--brand-purple);
  background: rgba(104, 0, 146, 0.06);
}

.choice input {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border: 1.5px solid var(--field-line);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.choice input[type="radio"] {
  border-radius: 50%;
}

.choice input:checked {
  background-color: var(--brand-purple);
  border-color: var(--brand-purple);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.choice input[type="radio"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.2' fill='%23fff'/%3E%3C/svg%3E");
}

.choice input:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
}

/* —— Signatures —— */
.signature-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.signature-pad-frame {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(transparent 78%, rgba(104, 0, 146, 0.12) 78%, rgba(104, 0, 146, 0.12) 79%, transparent 79%),
    #fff;
  overflow: hidden;
  touch-action: none;
  min-height: 110px;
}

.signature-pad {
  display: block;
  width: 100%;
  height: 120px;
  cursor: crosshair;
}

.signature-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-clear-signature {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--brand-deep);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-clear-signature:hover {
  background: rgba(104, 0, 146, 0.06);
}

.signature-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* —— Review —— */
.review-summary {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.review-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--field-bg);
}

.review-block__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-purple);
}

.review-block dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.review-block .review-row {
  display: grid;
  grid-template-columns: minmax(7rem, 34%) 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.88rem;
}

.review-block dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.review-block dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

.review-hint {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.review-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* —— Nav / actions —— */
.wizard-nav {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.wizard-nav__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.btn-back,
.btn-next,
.btn-submit {
  appearance: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.btn-back {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--brand-deep);
  margin-right: auto;
}

.btn-back:hover {
  background: rgba(104, 0, 146, 0.05);
}

.btn-next,
.btn-submit {
  border: none;
  background: var(--gold);
  color: #252425;
  box-shadow: 0 4px 14px rgba(252, 188, 69, 0.35);
  font-family: var(--font-serif);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}

.btn-next:hover:not(:disabled),
.btn-submit:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-submit {
  background: var(--brand-purple);
  color: #fff;
  box-shadow: 0 4px 14px rgba(104, 0, 146, 0.3);
}

.btn-next:disabled,
.btn-submit:disabled,
.btn-back:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.form-status {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: center;
}

.form-status--ok {
  background: #ecfdf3;
  color: var(--ok);
  border: 1px solid #abefc6;
}

.form-status--error {
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #fecdca;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* —— Footer —— */
.app-footer {
  margin-top: 0.5rem;
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  background: var(--brand-deep);
  color: #fff;
}

.app-footer__values {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.app-footer__slogan {
  margin: 0.85rem 0 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.88);
}

/* —— Responsive —— */
@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1rem;
  }

  .app-header__logo {
    width: 160px;
  }

  .app-header__mission {
    margin-left: auto;
    margin-right: auto;
  }

  .wizard-panel {
    padding: 1.1rem 1rem;
  }

  .checkbox-group__options--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--half,
  .field--third,
  .field--two-thirds,
  .field--quarter {
    flex: 1 1 100%;
  }

  .review-block .review-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .wizard-nav__buttons {
    flex-direction: column-reverse;
  }

  .btn-back,
  .btn-next,
  .btn-submit {
    width: 100%;
    margin-right: 0;
    text-align: center;
  }

  .wizard-steps {
    display: none;
  }
}

@media print {
  body.application-page {
    background: #fff;
  }

  .app-topbar,
  .wizard-progress,
  .wizard-nav,
  .skip-link {
    display: none !important;
  }

  .wizard-panel[hidden] {
    display: block !important;
  }
}
