@import url("https://fonts.googleapis.com/css2?family=Inter:wght@600;700&display=swap");

:root {
  --text: #1b2733;
  --bg: #f7fafc;
  --primary: #2b6cb0;
  --primary-hover: #245a94;
  --primary-pressed: #1e4a7a;
  --card: #ffffff;
  --border: #d9e2ec;
  --muted: #5a6a7a;
  --error: #c53030;
  --error-bg: #fff5f5;
  --radius: 12px;
  --space-section: 64px;
  --wrap: 680px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-hover);
}

h1,
h2,
h3 {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px;
}

.site-header {
  padding: 12px 0 8px;
}

.site-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.calc-section {
  margin-top: 16px;
}

.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.field .hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.field input,
.field select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.3;
}

.field input:focus,
.field select:focus,
.btn:focus-visible,
.faq summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  margin-top: 4px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn:active:not(:disabled) {
  background: var(--primary-pressed);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.result {
  min-height: 228px;
  margin-top: 16px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.result.is-empty {
  color: var(--muted);
}

.result-placeholder {
  margin: 0;
}

.result-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.metric-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.metric-value {
  font-family: Inter, system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.result-copy {
  margin: 0 0 12px;
}

.result-stats {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.result-source {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.result-error {
  margin: 0;
  padding: 12px;
  color: var(--error);
  background: var(--error-bg);
  border-radius: 8px;
}

.section {
  margin-top: var(--space-section);
}

.prose h2 {
  margin-bottom: 16px;
}

.prose p {
  max-width: 42em;
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
}

.faq summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details p {
  margin: 0 0 16px;
  color: var(--text);
}

.site-footer {
  margin-top: var(--space-section);
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-heading {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer-copy {
  margin: 0;
}

@media (min-width: 640px) {
  .wrap {
    padding: 24px;
  }

  h1 {
    font-size: 2rem;
  }

  .calc-card,
  .result {
    padding: 24px;
  }
}
