:root {
  --ink: #3c332d;
  --muted: #776a62;
  --cream: #fff7ec;
  --paper: #fffdf8;
  --line: #ddcfc3;
  --coral: #e97567;
  --coral-dark: #bd5349;
  --pink: #f3c7d2;
  --yellow: #f4d97b;
  --green: #c9ddbc;
  --blue: #bfd7e7;
  --lavender: #d8cae8;
  --shadow: 0 12px 0 rgba(88, 63, 49, .06), 0 16px 34px rgba(88, 63, 49, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(117, 92, 71, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 92, 71, .035) 1px, transparent 1px),
    var(--cream);
  background-size: 24px 24px;
  font-family: "DM Sans", sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.paper-noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .13; z-index: -1;
  background-image: radial-gradient(rgba(60,51,45,.35) .5px, transparent .5px);
  background-size: 9px 9px;
}

.site-header { padding: 54px 20px 28px; }
.header-inner {
  max-width: 1040px; margin: 0 auto; position: relative; display: flex; gap: 18px; align-items: flex-start;
}
.brand-mark {
  width: 54px; height: 54px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: 17px 17px 17px 6px;
  display: grid; place-items: center; background: var(--yellow); font-size: 28px; transform: rotate(-3deg);
  box-shadow: 4px 4px 0 var(--ink);
}
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; color: var(--coral-dark); }
h1, h2 { font-family: "Fredoka", sans-serif; letter-spacing: -.02em; }
h1 { margin: 0; max-width: 720px; font-size: clamp(36px, 6vw, 62px); line-height: .98; }
.subtitle { margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.doodle-star { position: absolute; right: 3%; top: -18px; font-size: 64px; transform: rotate(14deg); color: var(--coral); }

.page-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 80px; }
form { display: grid; gap: 24px; }
.sheet-card {
  position: relative; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); overflow: visible;
}
.sheet-card::after { content: ""; position: absolute; inset: 7px -5px -7px 5px; z-index: -1; border: 1px solid rgba(60,51,45,.1); border-radius: inherit; background: rgba(255,255,255,.45); }
.section-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; position: relative; }
.section-number {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1.5px solid var(--ink); border-radius: 50%;
  font-family: "Fredoka"; font-weight: 700; background: white;
}
.section-kicker { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.05; }
.helper-copy { margin: -10px 0 22px; color: var(--muted); }

.tape { position: absolute; width: 72px; height: 24px; right: 28px; top: -34px; opacity: .82; transform: rotate(4deg); }
.tape-yellow { background: var(--yellow); }
.tape-pink { background: var(--pink); transform: rotate(-4deg); }
.mini-sticker {
  position: absolute; right: 6px; top: -18px; width: 66px; height: 66px; display: grid; place-items: center; text-align: center;
  font: 700 12px/1.05 "Fredoka"; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--green); transform: rotate(8deg);
}
.scribble { margin-left: auto; text-align: center; font: 700 13px/1.05 "Fredoka"; color: var(--coral-dark); transform: rotate(-5deg); }

.form-grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; font-weight: 800; }
.field em { color: var(--coral-dark); font-style: normal; }
.field small { color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 13px; background: #fffefb; color: var(--ink);
  padding: 13px 14px; outline: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus, textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(233,117,103,.12); }
input::placeholder, textarea::placeholder { color: #ab9f97; }
textarea { resize: vertical; min-height: 112px; }

.rating-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.rating-card { display: grid; gap: 9px; padding: 14px; border: 1px dashed var(--line); border-radius: 15px; background: #fffdfa; }
.rating-card:nth-child(1) { background: #fff6df; }
.rating-card:nth-child(2) { background: #eef6e9; }
.rating-card:nth-child(3) { background: #f3eef9; }
.rating-card:nth-child(4) { background: #eaf4f9; }
.rating-card:nth-child(5) { background: #fbecef; }
.rating-card strong { font-size: 13px; }
.rating-card select { background-color: rgba(255,255,255,.78); font-size: 13px; padding-top: 11px; padding-bottom: 11px; }

.book-box { margin-top: 20px; padding: 18px; border: 1px dashed #bdafa3; border-radius: 17px; background: #faf6ee; }
.book-box-title { display: flex; gap: 11px; align-items: center; margin-bottom: 15px; }
.book-box-title > span { font-size: 25px; }
.book-box-title div { display: grid; }
.book-box-title small { color: var(--muted); }

.notes-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.note-choice { position: relative; }
.note-choice input { position: absolute; opacity: 0; pointer-events: none; }
.note-choice label {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; height: 100%;
  padding: 15px; border: 1.5px solid var(--line); border-radius: 15px; background: #fffdfa; transition: transform .15s ease, border-color .15s ease, background .15s ease;
  cursor: pointer;
}
.note-choice label:hover { transform: translateY(-1px); border-color: #bfa99b; }
.note-choice input:checked + label { border-color: var(--coral); background: #fff2ee; box-shadow: inset 0 0 0 1px var(--coral); }
.check-dot {
  width: 24px; height: 24px; border: 1.5px solid var(--ink); border-radius: 7px; display: grid; place-items: center; background: white;
  font-size: 13px; font-weight: 900;
}
.note-choice input:checked + label .check-dot { background: var(--coral); color: white; }
.note-copy strong { display: block; margin-bottom: 3px; font-size: 14px; }
.note-copy small { display: block; color: var(--muted); line-height: 1.45; }
.custom-note { margin-top: 20px; }

.action-bar {
  position: sticky; bottom: 14px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 18px;
  background: rgba(60,51,45,.96); color: white; border-radius: 18px; padding: 14px 14px 14px 18px; box-shadow: 0 16px 35px rgba(60,51,45,.22);
}
.action-copy { display: grid; }
.action-copy span { color: #ded5cf; font-size: 13px; }
.button { border: 1.5px solid var(--ink); border-radius: 12px; padding: 12px 17px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 #1f1a17; }
.button-secondary { background: white; color: var(--ink); }
.button-whatsapp { background: var(--green); color: var(--ink); }

.result-wrap { margin-top: 42px; scroll-margin-top: 24px; }
.result-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 18px; }
.result-stamp { display: grid; place-items: center; width: 70px; height: 70px; border: 2px dashed var(--coral-dark); border-radius: 50%; font: 700 16px "Fredoka"; color: var(--coral-dark); transform: rotate(8deg); }
.report-paper {
  background: #fffef9; border: 1.5px solid var(--line); border-radius: 4px; padding: 28px; box-shadow: var(--shadow);
  background-image: linear-gradient(#edf0ee 1px, transparent 1px); background-size: 100% 28px;
}
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 500 14px/28px "DM Sans", sans-serif; color: #2f2925; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.status-text { min-height: 24px; text-align: right; color: var(--muted); font-size: 13px; }

.site-footer { max-width: 1040px; margin: -48px auto 0; padding: 24px 20px 48px; display: flex; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; }
.invalid { border-color: #c94f45 !important; box-shadow: 0 0 0 4px rgba(201,79,69,.10) !important; }

@media (max-width: 820px) {
  .rating-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .site-header { padding-top: 34px; }
  .header-inner { gap: 12px; }
  .brand-mark { width: 43px; height: 43px; border-radius: 14px 14px 14px 5px; font-size: 22px; box-shadow: 3px 3px 0 var(--ink); }
  h1 { font-size: 35px; }
  .subtitle { font-size: 14px; }
  .doodle-star { display: none; }
  .page-shell { width: min(100% - 20px, 1040px); }
  .sheet-card { padding: 20px 16px; border-radius: 18px; }
  .two-col, .book-grid, .rating-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .mini-sticker { right: -6px; top: -28px; transform: scale(.85) rotate(8deg); }
  .scribble { display: none; }
  .action-bar { bottom: 8px; display: grid; padding: 12px; }
  .action-copy { padding: 0 2px; }
  .button-primary { width: 100%; }
  .report-paper { padding: 18px 14px; }
  .result-header { align-items: center; }
  .result-stamp { width: 58px; height: 58px; font-size: 13px; flex: 0 0 auto; }
  .result-actions { display: grid; grid-template-columns: 1fr; }
  .result-actions .button { width: 100%; }
}


/* WhatsApp destination chooser */
.wa-modal[hidden] { display: none; }
.wa-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.wa-modal-backdrop { position: absolute; inset: 0; background: rgba(47, 41, 37, .52); backdrop-filter: blur(2px); }
.wa-dialog {
  position: relative; z-index: 1; width: min(100%, 470px); padding: 26px; overflow: hidden;
  background: #fffdf7; border: 1.5px solid var(--line); border-radius: 21px 21px 21px 8px;
  box-shadow: 8px 9px 0 rgba(47, 41, 37, .18), 0 22px 60px rgba(47, 41, 37, .24);
}
.wa-dialog::before { content: ''; position: absolute; width: 86px; height: 24px; top: -3px; left: 34px; background: rgba(244, 206, 113, .68); transform: rotate(-3deg); }
.wa-dialog-close { position: absolute; z-index: 2; top: 12px; right: 14px; width: 35px; height: 35px; border: 1.5px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 22px; line-height: 1; }
.wa-dialog-doodle { position: absolute; right: 58px; top: 19px; font-size: 23px; transform: rotate(12deg); }
.wa-dialog h2 { margin: 4px 0 8px; }
.wa-dialog-copy { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.wa-choice-list { display: grid; gap: 10px; }
.wa-choice {
  width: 100%; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; text-align: left;
  padding: 14px; border: 1.5px solid var(--line); border-radius: 15px; color: var(--ink); transition: transform .15s ease, border-color .15s ease;
}
.wa-choice:hover { transform: translateY(-1px); border-color: #98887d; }
.wa-choice-app { background: #edf7e9; }
.wa-choice-web { background: #eef4f8; }
.wa-choice-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.78); font-size: 21px; }
.wa-choice strong, .wa-choice small { display: block; }
.wa-choice small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.wa-dialog-note { display: block; margin-top: 14px; color: var(--muted); }
body.wa-modal-open { overflow: hidden; }

@media (max-width: 620px) {
  .wa-dialog { padding: 24px 18px 18px; }
  .wa-choice { grid-template-columns: 40px 1fr auto; }
}
