:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1f7a63;
  --brand-dark: #17624f;
  --accent: #1f7a63;
  --result: #17624f;
  --danger: #b3261e;
  --soft: #e8f5f1;
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.hero {
  padding: 8px 2px 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 2.15rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.role-hint {
  display: inline-block;
  margin: 14px 0 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.progress {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebe4;
}

.progress-fill {
  height: 100%;
  width: 20%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 180ms ease;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.step h2 {
  margin-bottom: 16px;
  font-size: 1.65rem;
  line-height: 1.15;
}

.step p {
  color: var(--muted);
  line-height: 1.5;
}

.notice {
  margin: 18px 0;
  padding: 15px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  line-height: 1.45;
}

.notice.soft {
  border-left-color: var(--brand);
  background: #f8fafc;
  color: var(--text);
}

fieldset {
  min-width: 0;
  margin: 0 0 26px;
  padding: 0;
  border: 0;
}

legend,
.field > span {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
  line-height: 1.3;
}

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

.choice-grid label {
  min-height: 56px;
  cursor: pointer;
}

.choice-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-grid span {
  display: grid;
  min-height: 56px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

.choice-grid input:checked + span {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand-dark);
}

.field {
  display: block;
  margin-bottom: 22px;
}

.field input {
  width: 100%;
  min-height: 56px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font-size: 1.15rem;
  background: #fff;
  color: var(--text);
}

.money-input {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  min-height: 58px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.money-input > span {
  display: grid;
  height: 100%;
  min-height: 56px;
  place-items: center;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  color: var(--brand);
  font-size: 1.15rem;
  font-weight: 900;
}

.money-input input {
  min-height: 56px;
  border: 0;
  border-radius: 0;
  padding-left: 14px;
}

.field input:focus,
.choice-grid input:focus + span {
  border-color: var(--accent);
  outline: 3px solid rgba(59, 130, 246, 0.18);
}

.money-input:focus-within {
  border-color: var(--accent);
  outline: 3px solid rgba(59, 130, 246, 0.18);
}

.money-input input:focus {
  outline: 0;
}

small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.4;
}

.error,
.form-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 700;
}

.form-error {
  margin-top: 16px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 22px;
}

button {
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

button,
.primary-link {
  display: grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.primary-link {
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

a.cta-button.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

button:hover {
  background: var(--brand-dark);
}

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

a.cta-button.primary-link:hover,
a.cta-button.primary-link:focus {
  background: var(--brand-dark);
  color: #fff;
  text-decoration: none;
}

button:active {
  transform: translateY(1px);
}

.primary-link:active {
  transform: translateY(1px);
}

button.secondary {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--brand);
}

button.secondary:hover {
  background: var(--soft);
}

button[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: var(--soft);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.result-card p {
  color: inherit;
}

.result-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.result-amount {
  margin-bottom: 4px;
  color: var(--result);
  font-size: 3.3rem;
  font-weight: 950;
  line-height: 1.05;
}

.result-period {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.result-explain {
  margin-bottom: 20px;
  color: var(--text);
  line-height: 1.45;
}

.direction-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.direction-grid div {
  padding: 14px;
  border: 1px solid rgba(31, 122, 99, 0.18);
  border-radius: 14px;
  background: #fff;
}

.direction-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.direction-grid strong {
  display: block;
  color: var(--brand);
  font-size: 1.15rem;
}

.trust-note {
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
}

.summary {
  margin-top: 26px;
}

.result-note {
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.cta-button {
  width: 100%;
  margin-top: 22px;
  padding: 0 20px;
  background: var(--accent);
}

.paid-value {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(31, 122, 99, 0.18);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

.paid-value p {
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 800;
}

.paid-value ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.payment-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
}

.payment-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.payment-status.success {
  color: var(--brand);
}

.payment-status.error {
  color: var(--danger);
}

.paid-report {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.paid-report[hidden] {
  display: none;
}

.report-muted {
  color: var(--muted);
}

.report-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.report-block h3 {
  margin-bottom: 10px;
  color: var(--brand);
}

.summary h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

dl {
  margin: 0;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  font-weight: 900;
}

@media (min-width: 620px) {
  .app-shell {
    padding-top: 44px;
  }

  h1 {
    font-size: 2.75rem;
  }

  .panel {
    padding: 30px;
  }

  .choice-grid.two,
  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .summary-row {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
}
