:root {
  color-scheme: light;
  --page: #ffffff;
  --panel: #ffffff;
  --text: #171717;
  --muted: #5c5c5c;
  --border: #c8c8c8;
  --accent: #b8322a;
  --accent-dark: #8f251f;
  --accent-soft: #f3f3f3;
  --error: #9f201a;
  --focus: #1e5aa8;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(100% - 32px, 680px);
  margin: 0 auto;
  padding: 48px 0 32px;
}

.page-header {
  margin-bottom: 28px;
}

.site-name {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 620px;
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 8vw, 4.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.introduction {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.step-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.step-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.step-number {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 750;
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #8d8579;
  border-radius: 6px;
  background: white;
  color: var(--text);
}

input::placeholder {
  color: #746d63;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-row + .field-help {
  margin-top: 8px;
}

.error-message {
  min-height: 1.5em;
  margin: 8px 0;
  color: var(--error);
  font-weight: 650;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

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

.secondary-button {
  border: 1px solid var(--accent);
  background: white;
  color: var(--accent-dark);
}

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

.result {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid #b8b8b8;
  border-radius: 8px;
  background: var(--accent-soft);
}

.result.is-new {
  animation: result-in 180ms ease-out;
}

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

.result-value {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 10vw, 4.5rem);
  line-height: 1;
}

.result-note {
  max-width: 500px;
  margin: -2px 0 16px;
  color: var(--muted);
}

.privacy-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

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

@keyframes result-in {
  from {
    opacity: 0.5;
    transform: translateY(3px);
  }

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

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 680px);
    padding-top: 28px;
  }

  .panel {
    padding: 19px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result.is-new {
    animation: none;
  }
}
