:root {
  color-scheme: light;
  --green: #0fab5a;
  --green-dark: #078844;
  --green-soft: #eefaf3;
  --ink: #101827;
  --text: #344054;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --canvas: #f7f9fb;
  --danger: #c4314b;
  --shadow: 0 10px 28px rgba(16, 24, 39, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: #fff;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.site-header {
  height: 76px;
  border-bottom: 1px solid #e8ebf0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(16, 24, 39, 0.05);
}

.header-inner {
  width: min(1380px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #111;
  text-decoration: none;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 5px 14px rgba(15, 171, 90, 0.24);
}

.brand-mark svg { width: 28px; fill: #fff; }

.github-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid #cfd5df;
  border-radius: 11px;
  color: #172033;
  background: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.github-button:hover { transform: translateY(-1px); border-color: #9ba5b4; box-shadow: 0 5px 14px rgba(16, 24, 39, 0.08); }
.github-button svg { width: 20px; fill: currentColor; }

main { background: linear-gradient(#fff 0, #fff 760px, #fbfcfd 100%); }

.hero {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 45px 0 40px;
}

.hero-copy { text-align: center; margin-bottom: 32px; }

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 4.2vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.048em;
  font-weight: 800;
}

.hero-copy > p {
  margin: 15px auto 0;
  max-width: 830px;
  color: #5a6678;
  font-size: clamp(17px, 1.5vw, 21px);
}

.feature-pills {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
}

.feature-pills span {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid #d6dce5;
  border-radius: 999px;
  color: var(--green-dark);
  background: #fff;
  font-size: 16px;
  font-weight: 700;
}

.feature-pills svg { width: 23px; height: 23px; fill: none; stroke: var(--green); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.tool-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.44fr) minmax(570px, 0.56fr);
  gap: 32px;
  align-items: stretch;
}

.tool-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.tool-card h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.form-card { padding: 34px 36px 40px; }
.form-card h2 { margin-bottom: 27px; }

.field-group { margin-bottom: 24px; }
.field-group label { display: block; margin-bottom: 8px; color: #243044; font-weight: 650; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row span { padding: 2px 8px; border-radius: 7px; background: #f1f3f6; color: #667085; font-size: 12px; }

input, textarea, select {
  width: 100%;
  border: 1px solid #cfd6e1;
  border-radius: 9px;
  background: #fff;
  color: #1c2637;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input, select { height: 48px; padding: 0 14px; }
textarea { min-height: 112px; padding: 12px 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa3b2; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15, 171, 90, 0.13); }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(196, 49, 75, 0.1); }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 42px; }
.select-wrap > svg { position: absolute; right: 14px; top: 50%; width: 20px; transform: translateY(-50%); fill: none; stroke: #667085; stroke-width: 2; pointer-events: none; }

.field-help, .field-error, .message-meta, .copy-help, .result-error { margin: 7px 0 0; font-size: 12px; }
.field-help, .message-meta, .copy-help { color: var(--muted); }
.field-error, .result-error { min-height: 18px; color: var(--danger); }
.message-meta { display: flex; justify-content: space-between; gap: 12px; }

.primary-button, .action-button {
  border-radius: 9px;
  font-weight: 750;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.primary-button svg, .action-button svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.generate-button {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #11b862, #07984e);
  box-shadow: 0 8px 18px rgba(15, 171, 90, 0.22);
  font-size: 17px;
}
.generate-button:hover { transform: translateY(-1px); box-shadow: 0 11px 23px rgba(15, 171, 90, 0.28); }
.generate-button:active { transform: translateY(0); }

.preview-card { padding: 34px 40px 32px; }
.preview-card h2 { margin-bottom: 25px; }
.preview-layout { display: grid; grid-template-columns: minmax(290px, 1fr) minmax(290px, 1.06fr); gap: 34px; align-items: center; }

.qr-shell {
  aspect-ratio: 1;
  width: 100%;
  max-width: 370px;
  justify-self: center;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid #d8dee7;
  border-radius: 15px;
  background: linear-gradient(145deg, #f4f6f8, #fff);
  box-shadow: inset 0 1px 2px rgba(16, 24, 39, 0.04);
}

#qr-canvas { width: 100%; height: 100%; border-radius: 4px; background: #fff; }

.qr-placeholder { width: 78%; text-align: center; color: #8a94a3; }
.qr-placeholder svg { width: 100%; max-width: 230px; fill: #d7dce4; }
.qr-placeholder span { display: block; margin-top: 12px; font-size: 13px; }

.result-panel { min-width: 0; }
.eyebrow { display: block; margin-bottom: 4px; color: #475467; font-size: 15px; }
#result-phone { display: block; margin-bottom: 14px; color: var(--green-dark); font-size: clamp(22px, 2vw, 29px); letter-spacing: -0.02em; overflow-wrap: anywhere; }

.message-preview {
  min-height: 70px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #bce5cc;
  border-radius: 10px;
  background: linear-gradient(135deg, #effbf4, #f7fcf9);
  color: #243044;
  overflow-wrap: anywhere;
}
.message-preview svg { width: 24px; flex: 0 0 auto; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.message-preview span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

.test-note { display: flex; align-items: flex-start; gap: 9px; margin: 15px 0 0; color: #667085; font-size: 13px; }
.test-note svg { width: 20px; flex: 0 0 auto; fill: none; stroke: #7890b4; stroke-width: 1.8; stroke-linecap: round; }

.action-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #cfd6e1;
  background: #fff;
  color: #202b3c;
  text-decoration: none;
}
.action-button:not(:disabled):not(.is-disabled):hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(16, 24, 39, 0.08); }
.action-button:disabled, .action-button.is-disabled { opacity: .48; cursor: not-allowed; pointer-events: none; }

.whatsapp-button { width: 100%; margin-top: 4px; border-color: var(--green); color: var(--green-dark); font-size: 16px; }
.download-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.download-primary { border-color: var(--green); color: #fff; background: var(--green); }
.secondary-button { background: #fff; }
.copy-button { width: 100%; margin-top: 12px; }
.copy-help { text-align: center; }

.below-fold {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 52px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.info-card { border: 1px solid #d9e1ea; border-radius: 15px; background: #fff; box-shadow: 0 7px 20px rgba(16, 24, 39, 0.04); overflow: hidden; }
.customize-card { background: linear-gradient(135deg, #f7fffa, #fff); }
.faq-card { background: linear-gradient(135deg, #f7faff, #fff); }
.info-card summary { list-style: none; min-height: 92px; display: grid; grid-template-columns: 50px 1fr 24px; align-items: center; gap: 15px; padding: 18px 28px; cursor: pointer; }
.info-card summary::-webkit-details-marker { display: none; }
.summary-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: #ecfaf2; color: var(--green); }
.faq-card .summary-icon { background: #edf4ff; color: #2374d9; }
.summary-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.info-card summary strong { display: block; font-size: 19px; }
.info-card summary small { display: block; margin-top: 3px; color: #667085; font-size: 14px; }
.chevron { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s ease; }
.info-card[open] .chevron { transform: rotate(90deg); }
.details-content { padding: 0 28px 24px 93px; color: #475467; }
.details-content label { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 10px 0; }
.details-content input[type="color"] { width: 52px; height: 34px; padding: 2px; }
.details-content button { margin-top: 8px; padding: 8px 12px; border: 1px solid #ccd4df; border-radius: 8px; background: #fff; }
.faq-content h3 { margin: 16px 0 5px; color: #1d2939; font-size: 16px; }
.faq-content p { margin: 0; }

footer { padding: 24px; border-top: 1px solid #e5e9ef; color: #667085; text-align: center; font-size: 14px; }

:focus-visible { outline: 3px solid rgba(15, 171, 90, .28); outline-offset: 3px; }

@media (max-width: 1060px) {
  .tool-grid { grid-template-columns: 1fr; }
  .form-card, .preview-card { padding: 32px; }
  .preview-layout { grid-template-columns: minmax(260px, .9fr) minmax(300px, 1.1fr); }
}

@media (max-width: 760px) {
  .site-header { height: 68px; }
  .header-inner, .hero, .below-fold { width: min(100% - 28px, 1280px); }
  .brand { font-size: 21px; }
  .brand-mark { width: 36px; height: 36px; }
  .github-button { min-height: 40px; padding: 0 12px; }
  .hero { padding-top: 34px; }
  .hero-copy { margin-bottom: 25px; }
  .feature-pills { gap: 10px; }
  .feature-pills span { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .preview-layout { grid-template-columns: 1fr; gap: 25px; }
  .qr-shell { max-width: 330px; }
  .below-fold { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .header-inner, .hero, .below-fold { width: min(100% - 20px, 1280px); }
  .brand span:last-child { display: none; }
  .github-button { font-size: 14px; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: 36px; }
  .hero-copy > p { font-size: 16px; }
  .feature-pills { justify-content: stretch; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .feature-pills span { min-width: 0; justify-content: center; padding: 0 7px; font-size: 12px; }
  .feature-pills svg { width: 18px; height: 18px; }
  .tool-grid { gap: 18px; }
  .form-card, .preview-card { padding: 24px 18px; border-radius: 13px; }
  .tool-card h2 { font-size: 22px; }
  .download-row { grid-template-columns: 1fr; }
  .message-meta { align-items: flex-end; }
  .message-meta span:first-child { max-width: 70%; }
  .info-card summary { grid-template-columns: 42px 1fr 20px; padding: 16px; }
  .summary-icon { width: 40px; height: 40px; }
  .details-content { padding: 0 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
