:root {
  --ink: #26302b;
  --muted: #68726d;
  --green: #314d40;
  --green-dark: #24382f;
  --sage: #dce6df;
  --rose: #eadbd8;
  --cream: #f7f4ee;
  --paper: #fffdf9;
  --line: #d9ded9;
  --shadow: 0 22px 65px rgba(36, 56, 47, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(234, 219, 216, .9), transparent 31rem),
    radial-gradient(circle at 92% 88%, rgba(220, 230, 223, .95), transparent 34rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 32px; }
.brand { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 72px; height: 72px; border: 1px solid rgba(49,77,64,.35); border-radius: 50%; color: var(--green); background: rgba(255,253,249,.55); font: 36px/1 Georgia, serif; }
.eyebrow, .step { margin: 0 0 6px; color: var(--green); font-size: 12px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; color: var(--green-dark); }
h1 { font-size: clamp(38px, 7vw, 64px); line-height: .95; }
h2 { font-size: 30px; }
.intro { margin: 11px 0 0; color: var(--muted); font-size: 16px; }

.card, .preview-card { border: 1px solid rgba(49,77,64,.12); border-radius: 24px; background: rgba(255,253,249,.94); box-shadow: var(--shadow); }
.card { padding: 30px; }
.section-heading, .preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.field-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.field { display: grid; gap: 8px; color: var(--green-dark); font-size: 14px; font-weight: 700; }
.field-wide { margin-top: 20px; }
.field small { color: var(--muted); font-size: 12px; font-weight: 450; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; color: var(--ink); background: #fff; outline: none; transition: border-color .18s, box-shadow .18s; }
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: #80998c; box-shadow: 0 0 0 4px rgba(128,153,140,.15); }
.filename-row { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.filename-row:focus-within { border-color: #80998c; box-shadow: 0 0 0 4px rgba(128,153,140,.15); }
.filename-row input { border: 0; border-radius: 0; box-shadow: none; }
.extension { padding: 0 15px; color: var(--muted); }
.whatsapp-fields { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; margin-top: 20px; padding: 20px; border-radius: 16px; background: #f2f6f3; }
.is-hidden { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.button { min-height: 46px; border: 0; border-radius: 999px; padding: 0 20px; font-weight: 750; }
.button-primary { min-width: 190px; color: white; background: var(--green); box-shadow: 0 10px 24px rgba(49,77,64,.22); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green); background: var(--sage); }
.button-light { min-height: 40px; color: var(--green); background: transparent; border: 1px solid var(--line); }
.status { min-height: 21px; margin: 14px 0 0; color: var(--green); font-size: 14px; font-weight: 650; }

.template-card { margin-top: 18px; box-shadow: none; }
summary { color: var(--green-dark); font-weight: 750; cursor: pointer; }
.template-content { padding-top: 16px; color: var(--muted); line-height: 1.55; }
.upload { display: inline-flex; align-items: center; margin-top: 4px; border-radius: 999px; padding: 12px 18px; color: var(--green); background: var(--sage); font-size: 14px; font-weight: 750; cursor: pointer; }
.upload input { display: none; }
.template-state { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; font-size: 13px; }
.text-button { border: 0; padding: 0; color: var(--green); background: none; text-decoration: underline; }

.preview-card { margin-top: 18px; padding: 30px; background: var(--green-dark); color: #eff5f1; }
.preview-card h2, .preview-card .step { color: #eff5f1; }
.preview-heading { margin-bottom: 18px; }
.badge { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 7px 11px; font-size: 11px; letter-spacing: .05em; }
pre { max-height: 320px; overflow: auto; margin: 0; border-radius: 14px; padding: 18px; background: rgba(0,0,0,.18); color: #dce8e1; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 0 5px; color: var(--muted); font-size: 12px; }

@media (max-width: 650px) {
  .shell { padding-top: 28px; }
  .brand { align-items: flex-start; }
  .brand-mark { flex-basis: 54px; height: 54px; font-size: 28px; }
  .intro { font-size: 14px; }
  .card, .preview-card { padding: 22px; border-radius: 19px; }
  .field-grid, .whatsapp-fields { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .button-light { padding: 0 14px; }
  .actions .button { width: 100%; }
  .template-state, footer { align-items: flex-start; flex-direction: column; }
}
