:root {
  color-scheme: light;
  --navy: #1b2a4a;
  --navy-deep: #14203a;
  --gold: #c9a469;
  --gold-light: #e1c995;
  --cream: #f6f1e7;
  --paper: #fffdf8;
  --teal: #2c7a72;
  --teal-light: #6fbfb5;
  --ink: #3a4256;
  --muted: #69728b;
  --border: #e6dcc6;
  --danger: #a34949;
  font-family: "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 85% 8%, rgb(201 164 105 / 14%), transparent 28rem),
    var(--cream);
  color: var(--ink);
  line-height: 1.8;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.flow-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.flow-header {
  background: var(--navy);
  color: var(--paper);
  padding: 22px clamp(20px, 5vw, 48px);
}

.brand-link {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: #faf6f1;
  border: 1px solid rgb(201 164 105 / 55%);
  border-radius: 12px;
  display: flex;
  height: 48px;
  justify-content: center;
  overflow: hidden;
  width: 48px;
}

.brand-mark img {
  display: block;
  height: 82%;
  object-fit: contain;
  width: 82%;
}

.brand-name {
  font-size: clamp(21px, 4vw, 27px);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
}

.brand-name span {
  color: var(--teal-light);
  font-family: "Zen Maru Gothic", sans-serif;
  font-weight: 700;
}

.flow-main {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: center;
  padding: clamp(40px, 7vw, 80px) 20px 72px;
}

.flow-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 22px 60px rgb(20 32 58 / 12%);
  max-width: 660px;
  overflow: hidden;
  width: 100%;
}

.flow-card__top {
  background: var(--navy);
  color: var(--paper);
  padding: clamp(30px, 6vw, 48px);
  position: relative;
}

.flow-card__top::after {
  border: 1px solid rgb(201 164 105 / 28%);
  border-radius: 50%;
  content: "";
  height: 190px;
  position: absolute;
  right: -80px;
  top: -105px;
  width: 190px;
}

.eyebrow {
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin: 0 0 12px;
}

.flow-title {
  font-family: "Zen Maru Gothic", sans-serif;
  font-size: clamp(27px, 6vw, 38px);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin: 0;
  position: relative;
  z-index: 1;
}

.flow-lead {
  color: #cbd0de;
  font-size: 14px;
  margin: 14px 0 0;
  max-width: 500px;
}

.flow-card__body {
  padding: clamp(28px, 6vw, 48px);
}

.flow-card--wide {
  max-width: 820px;
}

.admission-form {
  display: grid;
  gap: 22px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
.consent-title {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea {
  background: #fff;
  border: 1px solid #d8cfbd;
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
  width: 100%;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(44 122 114 / 12%);
  outline: none;
}

.consent-list {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.consent-row {
  align-items: flex-start;
  display: flex;
  font-size: 13px;
  gap: 10px;
}

.consent-row input {
  flex: none;
  height: 18px;
  margin-top: 5px;
  width: 18px;
}

.policy-box {
  background: #f7f3ea;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: #4d566d;
  font-size: 13px;
  padding: 16px 18px;
}

.policy-box strong {
  color: var(--navy);
}

.policy-list {
  margin: 8px 0 0;
  padding-left: 1.4em;
}

.flow-message {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.flow-message--error {
  color: var(--danger);
  font-weight: 700;
}

.flow-message--success {
  color: var(--teal);
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
}

.status-panel {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.status-row {
  align-items: flex-start;
  display: flex;
  gap: 13px;
}

.status-dot {
  animation: pulse 1.5s ease-in-out infinite;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(201 164 105 / 15%);
  flex: none;
  height: 10px;
  margin-top: 9px;
  width: 10px;
}

.status-panel[data-state="eligible"] .status-dot,
.status-panel[data-state="complete"] .status-dot {
  animation: none;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgb(44 122 114 / 14%);
}

.status-panel[data-state="error"] .status-dot,
.status-panel[data-state="expired"] .status-dot,
.status-panel[data-state="review_required"] .status-dot {
  animation: none;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgb(163 73 73 / 12%);
}

.status-title {
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.status-message {
  color: var(--muted);
  font-size: 13.5px;
  margin: 3px 0 0;
}

.action-stack {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.button {
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  gap: 9px;
  justify-content: center;
  min-height: 56px;
  padding: 14px 24px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  width: 100%;
}

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

.button:focus-visible,
.text-link:focus-visible,
.brand-link:focus-visible {
  outline: 3px solid var(--teal-light);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button--primary {
  background: var(--gold);
  box-shadow: 0 10px 28px rgb(201 164 105 / 32%);
  color: var(--navy);
}

.button--primary:hover {
  background: #d6b579;
}

.button--secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--navy);
}

.support-box {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 24px;
}

.support-box h2 {
  color: var(--navy);
  font-family: "Zen Maru Gothic", sans-serif;
  font-size: 16px;
  margin: 0 0 6px;
}

.support-box p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.text-link {
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
  text-underline-offset: 4px;
}

.completion-icon {
  align-items: center;
  background: rgb(44 122 114 / 12%);
  border: 1px solid rgb(44 122 114 / 28%);
  border-radius: 50%;
  color: var(--teal);
  display: flex;
  font-size: 34px;
  font-weight: 900;
  height: 74px;
  justify-content: center;
  margin-bottom: 20px;
  width: 74px;
}

.notice {
  background: #fff9ec;
  border: 1px solid #ead7aa;
  border-radius: 14px;
  color: #665532;
  font-size: 14px;
  margin: 22px 0 0;
  padding: 16px 18px;
}

.flow-footer {
  color: var(--muted);
  font-size: 11px;
  padding: 0 20px 24px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-width: 520px) {
  .flow-header {
    padding: 17px 18px;
  }

  .brand-mark {
    height: 42px;
    width: 42px;
  }

  .flow-main {
    align-items: flex-start;
    padding: 24px 14px 48px;
  }

  .flow-card {
    border-radius: 20px;
  }

  .flow-card__top,
  .flow-card__body {
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
