:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-soft: #eaf7ed;
  --text: #18201b;
  --muted: #68716b;
  --bg: #f5f8f6;
  --card: #ffffff;
  --border: #e1e8e3;
  --input: #ffffff;
  --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 15% 0%, #e8f7ec 0, transparent 35%),
    radial-gradient(circle at 90% 10%, #edf8f0 0, transparent 30%),
    var(--bg);
  line-height: 1.6;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.qr-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: 760px;
  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.8);
  color: #69736d;
  font-size: 12px;
}

/* =========================================================
   MAIN TOOL CARD
   ========================================================= */

.tool-card {
  padding: 25px;
  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: 28px;
  height: 28px;
  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.3;
}

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

/* =========================================================
   INPUT AREA
   ========================================================= */

.input-area {
  margin-top: 22px;
}

.input-group {
  min-width: 0;
  margin-bottom: 17px;
}

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

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  border: 1px solid #d5dfd8;
  border-radius: 11px;
  outline: none;
  background: var(--input);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input,
.input-group select {
  min-height: 48px;
  padding: 10px 13px;
}

.input-group textarea {
  min-height: 105px;
  padding: 12px 13px;
  resize: vertical;
}

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

.extra-inputs {
  margin-top: 5px;
  padding: 17px;
  border: 1px solid #dce8df;
  border-radius: 14px;
  background: #f8fbf9;
}

.extra-inputs .input-group:last-child {
  margin-bottom: 0;
}

/* CHECKBOX */

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

/* =========================================================
   DIVIDER
   ========================================================= */

.section-divider {
  height: 1px;
  margin: 25px 0;
  background: #edf1ee;
}

/* =========================================================
   CUSTOMIZATION
   ========================================================= */

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

.customize-grid .input-group {
  margin-bottom: 16px;
}

.color-group {
  margin-bottom: 16px;
}

.color-control {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid #d5dfd8;
  border-radius: 11px;
  background: var(--input);
}

.color-control input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.color-control span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   BUTTONS
   ========================================================= */

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

.primary-btn,
.secondary-btn,
.download-btn {
  min-height: 45px;
  padding: 10px 19px;
  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);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.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;
}

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

/* QR PREVIEW */

.qr-preview-card {
  width: min(100%, 410px);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid #dce9df;
  border-radius: 18px;
  background: #fff;
}

.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  padding: 18px;
  border-radius: 13px;
  background:
    linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
    linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.qr-canvas-wrap canvas {
  display: block;
  width: min(100%, 280px);
  height: auto;
  aspect-ratio: 1 / 1;
  border: 1px solid #e2e2e2;
  background: #fff;
  image-rendering: pixelated;
}

.qr-preview-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  text-align: left;
}

.qr-preview-info span {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.qr-preview-info small {
  color: var(--muted);
  font-size: 11px;
}

/* DOWNLOAD */

.download-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

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

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

/* =========================================================
   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;
  --input: #1c251f;

  background:
    radial-gradient(circle at 15% 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"] .input-group textarea,
html[data-theme="dark"] .input-group select,
html[data-theme="dark"] .color-control,
html[data-theme="dark"] .secondary-btn {
  background: #1c251f;
  color: #edf4ef;
  border-color: #39463e;
}

html[data-theme="dark"] .extra-inputs {
  background: #152019;
  border-color: #344238;
}

html[data-theme="dark"] .section-divider {
  background: #2b352e;
}

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

html[data-theme="dark"] .qr-preview-card {
  background: #fff;
  border-color: #39463e;
}

html[data-theme="dark"] .qr-preview-info span {
  color: #2e7d32;
}

html[data-theme="dark"] .qr-preview-info small {
  color: #68716b;
}

/* =========================================================
   SENIOR MODE
   ========================================================= */

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

html[data-theme="senior"] .qr-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,
html[data-theme="senior"] .color-group label {
  font-size: 17px;
}

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

html[data-theme="senior"] .input-group textarea {
  min-height: 125px;
}

html[data-theme="senior"] .color-control {
  min-height: 55px;
  border: 2px solid #222;
}

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

html[data-theme="senior"] .result-section {
  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;
}

/* =========================================================
   TABLET
   ========================================================= */

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

/* =========================================================
   MOBILE
   ========================================================= */

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

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

  .tool-hero h1 {
    font-size: 35px;
    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;
  }

  .customize-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

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

  .result-section {
    padding: 24px 12px;
  }

  .qr-preview-card {
    padding: 12px;
  }

  .qr-canvas-wrap {
    min-height: 230px;
    padding: 12px;
  }

  .qr-canvas-wrap canvas {
    width: min(100%, 230px);
  }

  .download-actions {
    flex-direction: column;
  }

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

  .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;
  }

  .qr-preview-info {
    flex-direction: column;
    gap: 3px;
  }
}
