:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-soft: #eaf7ed;
  --text: #18201b;
  --muted: #68716b;
  --bg: #f5f8f6;
  --card: #ffffff;
  --border: #e1e8e3;
  --shadow: 0 14px 40px rgba(30, 60, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, #e9f8ed 0, transparent 35%),
    radial-gradient(circle at 90% 10%, #edf8f0 0, transparent 30%),
    var(--bg);
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

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

.age-page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 36px 0 70px;
}

/* HERO */

.tool-hero {
  max-width: 850px;
  margin: 0 auto 34px;
  text-align: center;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid #ccebd3;
  border-radius: 999px;
  background: #effaf1;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.tool-hero h1 {
  margin: 14px 0 8px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.05;
  letter-spacing: -1.8px;
}

.tool-hero p {
  max-width: 740px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
}

.hero-points {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.hero-points span {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #69736d;
  font-size: 12px;
}

/* MAIN CARD */

.tool-card {
  padding: 24px;
  border: 1px solid rgba(35, 70, 45, 0.08);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-number {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.step-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.step-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* INPUTS */

.date-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.input-group {
  min-width: 0;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.input-group input {
  width: 100%;
  min-height: 50px;
  padding: 10px 13px;
  border: 1px solid #d5dfd8;
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: 0.2s ease;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* BUTTONS */

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-btn,
.secondary-btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(46, 125, 50, 0.18);
}

.primary-btn:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.secondary-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.secondary-btn:hover {
  border-color: #b8c7bc;
  background: #f7faf8;
}

/* RESULT */

.result-section {
  margin-top: 28px;
  padding: 30px 20px;
  border: 1px solid #cde8d2;
  border-radius: 18px;
  background: linear-gradient(135deg, #f0faf2, #f8fcf9);
  text-align: center;
}

.success-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}

.result-section h2 {
  margin: 0;
  font-size: 21px;
}

.age-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 650px;
  margin: 22px auto 14px;
}

.age-value {
  padding: 18px 10px;
  border: 1px solid #d8e9dc;
  border-radius: 14px;
  background: #fff;
}

.age-value strong {
  display: block;
  color: var(--primary-dark);
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1;
}

.age-value span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.result-summary {
  margin: 7px auto 20px;
  color: var(--muted);
  font-size: 13px;
}

.extra-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 650px;
  margin: 0 auto;
}

.extra-card {
  padding: 13px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.extra-card span {
  display: block;
  margin-bottom: 4px;
  font-size: 19px;
}

.extra-card strong {
  display: block;
  font-size: 17px;
  color: var(--primary-dark);
}

.extra-card small {
  color: var(--muted);
  font-size: 10px;
}

.birthday-info {
  max-width: 650px;
  margin: 17px auto 0;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

/* HOW TO */

.how-to {
  margin-top: 45px;
}

.section-heading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  text-align: center;
}

.section-heading > span {
  font-size: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.info-card,
.feature-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  transition: 0.2s ease;
}

.info-card:hover,
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(30, 60, 40, 0.06);
}

.info-card > span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.info-card h3,
.feature-card h3 {
  margin: 7px 0 4px;
  font-size: 14px;
}

.info-card p,
.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

/* FEATURES */

.features-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.feature-card > span {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

/* DARK MODE */

html[data-theme="dark"] body {
  --text: #edf4ef;
  --muted: #aebbb2;
  --bg: #101512;
  --card: #18201b;
  --border: #303b34;

  background:
    radial-gradient(circle at 20% 0%, #172c1d 0, transparent 35%),
    radial-gradient(circle at 90% 10%, #18281d 0, transparent 30%),
    #101512;
}

html[data-theme="dark"] .tool-badge {
  background: #17331e;
  border-color: #285a31;
  color: #9fe0a7;
}

html[data-theme="dark"] .hero-points span {
  background: #18201b;
  border-color: #303b34;
  color: #aebbb2;
}

html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .feature-card {
  background: #18201b;
  border-color: #303b34;
}

html[data-theme="dark"] .input-group input,
html[data-theme="dark"] .secondary-btn {
  background: #1c251f;
  color: #edf4ef;
  border-color: #39463e;
}

html[data-theme="dark"] .age-value {
  background: #1c251f;
  border-color: #39463e;
}

html[data-theme="dark"] .age-value strong,
html[data-theme="dark"] .extra-card strong {
  color: #a6dfad;
}

html[data-theme="dark"] .extra-card {
  background: #18201b;
  border-color: #39463e;
}

html[data-theme="dark"] .result-section {
  background: linear-gradient(135deg, #15291a, #18241b);
  border-color: #315c38;
}

html[data-theme="dark"] .birthday-info {
  background: #17351e;
  color: #a6dfad;
}

/* SENIOR MODE */

html[data-theme="senior"] body {
  font-size: 18px;
  background: #f4f4f4;
}

html[data-theme="senior"] .age-page {
  max-width: 1200px;
}

html[data-theme="senior"] .tool-hero h1 {
  font-size: clamp(38px, 7vw, 58px);
  letter-spacing: -1px;
}

html[data-theme="senior"] .tool-hero p {
  font-size: 17px;
}

html[data-theme="senior"] .tool-card {
  border: 2px solid #222;
}

html[data-theme="senior"] .tool-badge,
html[data-theme="senior"] .hero-points span {
  border: 2px solid #222;
  background: #fff;
  color: #111;
  font-size: 15px;
}

html[data-theme="senior"] .step-heading h2 {
  font-size: 21px;
}

html[data-theme="senior"] .step-heading p {
  font-size: 16px;
}

html[data-theme="senior"] .input-group label {
  font-size: 17px;
}

html[data-theme="senior"] .input-group input {
  min-height: 55px;
  border: 2px solid #222;
  font-size: 17px;
}

html[data-theme="senior"] .primary-btn,
html[data-theme="senior"] .secondary-btn {
  min-height: 52px;
  padding: 11px 20px;
  font-size: 17px;
}

html[data-theme="senior"] .age-value {
  border: 2px solid #222;
}

html[data-theme="senior"] .age-value strong {
  font-size: 48px;
}

html[data-theme="senior"] .age-value span,
html[data-theme="senior"] .extra-card small {
  font-size: 14px;
}

html[data-theme="senior"] .extra-card {
  border: 2px solid #222;
}

html[data-theme="senior"] .info-card,
html[data-theme="senior"] .feature-card {
  border: 2px solid #222;
  background: #fff;
}

html[data-theme="senior"] .info-card h3,
html[data-theme="senior"] .feature-card h3 {
  font-size: 18px;
}

html[data-theme="senior"] .info-card p,
html[data-theme="senior"] .feature-card p {
  font-size: 14px;
}

html[data-theme="senior"] .result-section {
  border: 2px solid #222;
}

/* TABLET */

@media (max-width: 900px) {
  .features-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* MOBILE */

@media (max-width: 640px) {
  .age-page {
    width: min(100% - 20px, 1180px);
    padding-top: 25px;
    padding-bottom: 45px;
  }

  .tool-hero {
    margin-bottom: 24px;
  }

  .tool-hero h1 {
    font-size: 36px;
    letter-spacing: -1.2px;
  }

  .tool-hero p {
    font-size: 13px;
  }

  .hero-points {
    gap: 6px;
  }

  .hero-points span {
    padding: 5px 8px;
    font-size: 10px;
  }

  .tool-card {
    padding: 15px;
    border-radius: 17px;
  }

  .date-input-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .action-row {
    flex-direction: column;
  }

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

  .age-result {
    gap: 7px;
  }

  .age-value {
    padding: 15px 5px;
  }

  .age-value strong {
    font-size: 30px;
  }

  .age-value span {
    font-size: 10px;
  }

  .extra-results {
    gap: 7px;
  }

  .extra-card {
    padding: 11px 5px;
  }

  .extra-card strong {
    font-size: 14px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .features-section {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 20px;
  }
}

/* SMALL PHONES */

@media (max-width: 380px) {
  .tool-hero h1 {
    font-size: 31px;
  }

  .tool-card {
    padding: 12px;
  }

  .age-result {
    grid-template-columns: 1fr;
  }

  .age-value strong {
    font-size: 34px;
  }
}
