/* Santa's Nice List certificate (nice-list.html, nice-list.js).
   Two halves: the page around the product (form, preview, checkout), in the
   site's own look, and the A4 pages themselves (.nl-page), laid out in
   pixels on a 794 x 1123 sheet, which is A4 at 96 CSS pixels to the inch.
   The PDF is drawn from those same rules by html2canvas, so they keep to
   what it can paint: no filters, blend modes or text gradients. */

.nl-main { width: 100%; max-width: 1180px; box-sizing: border-box; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.nl-hero { margin: 0.5rem 0 1.5rem; max-width: 720px; }
.nl-hero h1 { font-size: 2.1rem; line-height: 1.15; margin: 0 0 0.6rem; letter-spacing: -0.02em; }
.nl-hero p { color: var(--text-muted); font-size: 1.05rem; margin: 0; }
.nl-hero .nl-price-tag {
    display: inline-block; margin: 0 0 0.6rem; padding: 0.2rem 0.65rem; border-radius: 999px;
    background: #FBE9E6; color: #9E1B22; font: 700 0.82rem 'Inter', sans-serif; letter-spacing: 0.03em;
}

/* Form on the left, the preview on the right and kept in view; on a phone,
   the child's details, then the preview, then paying. */
.nl-layout {
    display: grid; gap: 1.25rem 2rem; align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-areas: "child preview" "pay preview";
}
.nl-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem 1.25rem; }
.nl-child { grid-area: child; }
.nl-pay-card { grid-area: pay; }
.nl-preview { grid-area: preview; position: sticky; top: 1rem; }
@media (max-width: 900px) {
    .nl-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "child" "preview" "pay"; }
    .nl-preview { position: static; }
    .nl-sheet { width: 100%; }
}

.nl-card h2 { font-size: 1.15rem; margin: 0 0 0.9rem; }
.nl-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.nl-field { margin: 0 0 1rem; }
.nl-field:last-child { margin-bottom: 0; }
.nl-field label, .nl-legend {
    display: block; font: 600 0.92rem 'Inter', sans-serif; color: var(--text-dark); margin: 0 0 0.35rem; padding: 0;
}
.nl-field label small { font-weight: 400; color: var(--text-muted); }
.nl-field input[type="text"], .nl-field input[type="email"], .nl-field textarea {
    width: 100%; box-sizing: border-box; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px;
    font: 400 1rem 'Inter', sans-serif; background: #fff; color: var(--text-dark);
}
.nl-field textarea { resize: vertical; min-height: 3.6rem; line-height: 1.45; }
.nl-field input:focus, .nl-field textarea:focus { outline: 2px solid var(--secondary); outline-offset: 1px; border-color: var(--secondary); }
.nl-field [aria-invalid="true"] { border-color: #B3261E; }
.nl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 520px) { .nl-row { grid-template-columns: 1fr; } }
.nl-help { display: flex; justify-content: space-between; gap: 0.75rem; margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--text-muted); }
.nl-help .nl-count { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nl-hint { margin: 0.3rem 0 0; font-size: 0.82rem; color: #8A5A00; }
.nl-error { margin: 0.3rem 0 0; font-size: 0.85rem; color: #B3261E; font-weight: 500; }

/* The two looks, as cards with a swatch. */
.nl-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.nl-theme-choice { position: relative; display: block; cursor: pointer; }
.nl-theme-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nl-theme-choice span {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem; border: 1.5px solid var(--border);
    border-radius: 10px; font: 500 0.9rem/1.25 'Inter', sans-serif; color: var(--text-dark); background: #fff;
}
.nl-theme-choice span::before {
    content: ''; flex: none; width: 2rem; height: 2.6rem; border-radius: 4px; box-sizing: border-box;
}
.nl-theme-choice.is-classic span::before { background: #FFFDF7; border: 3px solid #9E1B22; box-shadow: inset 0 0 0 2px #FFFDF7, inset 0 0 0 3.5px #C9A13B; }
.nl-theme-choice.is-parchment span::before { background: #EBD6A6; border: 3px solid #5B3A1D; box-shadow: inset 0 0 0 2px #EBD6A6, inset 0 0 0 3.5px #B08A3E; }
.nl-theme-choice input:checked + span { border-color: var(--secondary); box-shadow: 0 0 0 1px var(--secondary); }
.nl-theme-choice input:focus-visible + span { outline: 2px solid var(--secondary); outline-offset: 2px; }

.nl-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; line-height: 1.45; color: var(--text-dark); cursor: pointer; }
.nl-check input { margin: 0.2rem 0 0; width: 1.05rem; height: 1.05rem; flex: none; accent-color: var(--secondary); }

.nl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 3rem; padding: 0.7rem 1.3rem;
    border: 0; border-radius: 999px; background: var(--secondary); color: #fff; cursor: pointer;
    font: 700 1rem 'Inter', sans-serif; text-decoration: none;
}
.nl-btn:hover { background: var(--secondary-dark); }
.nl-btn:disabled { opacity: 0.7; cursor: progress; }
.nl-btn-pay { width: 100%; margin: 1rem 0 0; background: #9E1B22; font-size: 1.05rem; }
.nl-btn-pay:hover { background: #7E141A; }
.nl-btn-secondary { background: #fff; color: var(--secondary); box-shadow: inset 0 0 0 1.5px var(--secondary); }
.nl-btn-secondary:hover { background: #EEF6F6; }
.nl-fine { margin: 0.6rem 0 0; font-size: 0.82rem; color: var(--text-muted); text-align: center; }
.nl-message { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-radius: 10px; font-size: 0.93rem; background: #EEF6F6; color: var(--text-dark); }
.nl-message.is-error { background: #FDECEA; color: #8C1D18; }

.nl-unlocked h2 { color: #1E5B37; }
.nl-unlocked p { margin: 0 0 0.75rem; }
.nl-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.25rem 0 0.5rem; }
.nl-actions .nl-btn { flex: 1 1 14rem; }
.nl-status { min-height: 1.3em; font-size: 0.88rem; color: var(--text-muted); margin: 0.25rem 0 0; }
.nl-tips { margin: 1rem 0 0; padding: 0.9rem 1rem; border-radius: 10px; background: #FBF6E9; border: 1px solid #EBDDB5; }
.nl-tips h3 { font-size: 0.98rem; margin: 0 0 0.4rem; }
.nl-tips ul { margin: 0; padding-left: 1.15rem; font-size: 0.9rem; line-height: 1.5; }
.nl-tips li + li { margin-top: 0.25rem; }
.nl-fix-note { margin: 0.3rem 0 0; font-size: 0.85rem; color: #8A5A00; }

/* ---- Preview: one page at a time, shrunk to the column's width. */
.nl-tabs { display: flex; gap: 0.4rem; margin: 0 auto 0.6rem; max-width: 30rem; }
.nl-tab {
    flex: 1; padding: 0.5rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); background: #fff;
    font: 600 0.9rem 'Inter', sans-serif; color: var(--text-dark); cursor: pointer;
}
.nl-tab[aria-selected="true"] { background: var(--secondary); border-color: var(--secondary); color: #fff; }
/* No taller than the window, so the whole page stays in view beside the form. */
.nl-sheet {
    position: relative; width: min(100%, calc((100vh - 7rem) * 0.7071)); margin: 0 auto; overflow: hidden; border-radius: 4px; background: #fff;
    box-shadow: 0 1px 2px rgba(33, 43, 43, 0.12), 0 10px 30px rgba(33, 43, 43, 0.16);
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.nl-sheet-scale { position: absolute; left: 0; top: 0; width: 794px; height: 1123px; transform-origin: 0 0; }
.nl-preview-note { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--text-muted); text-align: center; }
.nl-is-paid .nl-preview-note { display: none; }

.nl-watermark { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.nl-watermark-rows {
    position: absolute; left: -45%; top: -25%; width: 190%; height: 150%;
    display: flex; flex-direction: column; justify-content: space-around; transform: rotate(-33deg);
}
.nl-watermark-rows div {
    white-space: nowrap; font: 700 31px 'Cinzel', Georgia, serif; letter-spacing: 0.12em; color: rgba(120, 16, 22, 0.17);
}
.nl-watermark-rows div:nth-child(even) { margin-left: -220px; }

.nl-faq { max-width: 760px; margin: 3rem 0 0; }
.nl-faq h2 { font-size: 1.35rem; margin: 0 0 1rem; }
.nl-faq h3 { font-size: 1.02rem; margin: 1.2rem 0 0.3rem; }
.nl-faq p { margin: 0; color: var(--text-dark); line-height: 1.6; }

/* ---- The A4 pages */
.nl-page {
    --nl-ink: #2B1B12; --nl-primary: #9E1B22; --nl-gold: #8A6519; --nl-muted: #6E5A45; --nl-name: #7E141A; --nl-sig: #1C2A5C;
    position: relative; width: 794px; height: 1123px; overflow: hidden; box-sizing: border-box;
    background: #FFFDF7; color: var(--nl-ink); text-align: center;
    font-family: 'Lora', Georgia, 'Times New Roman', serif; font-weight: 400;
}
.nl-page.nl-theme-parchment {
    --nl-ink: #3A2513; --nl-primary: #5B3A1D; --nl-gold: #7A5A22; --nl-muted: #6B5236; --nl-name: #5B2A14; --nl-sig: #2A1A0C;
    background: #F4E5C1;
}
.nl-page :where(p, h2) { margin: 0; }
.nl-art { position: absolute; left: 0; top: 0; }
.nl-sample { opacity: 0.5; }

.nl-cert-body {
    position: absolute; left: 72px; right: 72px; top: 74px; bottom: 58px;
    display: flex; flex-direction: column; align-items: center;
}
.nl-dept { font: 600 15px/1.3 'Cinzel', Georgia, serif; letter-spacing: 0.2em; text-transform: uppercase; color: var(--nl-primary); }
.nl-registry { font: italic 400 14px/1.4 'Lora', Georgia, serif; color: var(--nl-muted); margin-top: 3px; }
.nl-divider { height: 22px; line-height: 0; margin: 12px 0 14px; }
.nl-kicker { font: 600 17px/1.2 'Cinzel', Georgia, serif; letter-spacing: 0.5em; text-transform: uppercase; color: var(--nl-gold); padding-left: 0.5em; }
.nl-title { font: 700 47px/1.12 'Cinzel', Georgia, serif; color: var(--nl-primary); letter-spacing: 0.01em; }
.nl-certifies { font: 600 14px/1.2 'Cinzel', Georgia, serif; letter-spacing: 0.32em; text-transform: uppercase; color: var(--nl-ink); margin-top: 38px; padding-left: 0.32em; }
.nl-name-box { width: 620px; height: 132px; display: flex; align-items: center; justify-content: center; }
.nl-name { display: inline-block; padding: 0 14px; white-space: nowrap; font-family: 'Great Vibes', 'Brush Script MT', cursive; font-size: 96px; line-height: 132px; color: var(--nl-name); }
.nl-town { font: italic 400 22px/1.3 'Lora', Georgia, serif; color: var(--nl-ink); margin-top: -6px; }
.nl-text { font-size: 17.5px; line-height: 1.6; max-width: 580px; margin-top: 30px; }
.nl-commended { font: 600 14px/1.2 'Cinzel', Georgia, serif; letter-spacing: 0.32em; text-transform: uppercase; color: var(--nl-primary); margin-top: 34px; padding-left: 0.32em; }
.nl-deeds-box { width: 600px; height: 140px; margin-top: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.nl-deeds { width: 100%; font-style: italic; font-size: 22px; line-height: 1.4; color: var(--nl-ink); }
.nl-deeds p + p { margin-top: 0.3em; }
.nl-text-small { font-size: 15.5px; line-height: 1.55; max-width: 560px; margin-top: 28px; color: var(--nl-ink); }
.nl-sign-row { margin-top: auto; width: 100%; box-sizing: border-box; padding: 0 18px; display: flex; align-items: flex-end; justify-content: space-between; }
.nl-sign { width: 224px; padding-bottom: 32px; }
.nl-sig, .nl-elf { height: 62px; display: flex; align-items: flex-end; justify-content: center; }
.nl-elf { font-family: 'Great Vibes', 'Brush Script MT', cursive; font-size: 54px; line-height: 62px; color: var(--nl-sig); transform: rotate(-3deg); }
.nl-sign-label {
    border-top: 1px solid var(--nl-ink); margin-top: 4px; padding-top: 7px;
    font: 600 11.5px/1.3 'Cinzel', Georgia, serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--nl-ink);
}
.nl-seal { width: 150px; height: 188px; }
.nl-number { margin-top: 6px; font: 400 10.5px/1.2 'Cinzel', Georgia, serif; letter-spacing: 0.2em; text-transform: uppercase; color: var(--nl-muted); }

.nl-letter-body {
    position: absolute; left: 96px; right: 96px; top: 70px; bottom: 64px;
    display: flex; flex-direction: column; align-items: center;
}
.nl-letter-from { font: italic 400 17px/1.3 'Lora', Georgia, serif; color: var(--nl-muted); }
.nl-letter-title { font: 700 42px/1.15 'Cinzel', Georgia, serif; color: var(--nl-primary); }
.nl-letter-place { font: 600 13px/1.3 'Cinzel', Georgia, serif; letter-spacing: 0.36em; text-transform: uppercase; padding-left: 0.36em; margin-top: 4px; }
.nl-letter-body .nl-divider { margin: 14px 0 8px; }
.nl-letter-box { width: 100%; flex: 1; min-height: 0; margin-top: 10px; text-align: left; overflow: hidden; }
.nl-letter-text { font-size: 19px; line-height: 1.72; color: var(--nl-ink); }
.nl-letter-text p { margin: 0 0 0.8em; }
.nl-letter-text .nl-dear { font-family: 'Great Vibes', 'Brush Script MT', cursive; font-size: 2.3em; line-height: 1.25; color: var(--nl-name); margin-bottom: 0.25em; }
.nl-letter-text .nl-closing { font-style: italic; margin: 1.3em 0 0; }
.nl-letter-sig { margin: 4px 0 0 -12px; }
.nl-letter-seal { position: absolute; right: -6px; bottom: -4px; }

/* PDF and print copies are built in .nl-export / .nl-print: fixed and
   unseen on screen, so they take no room and add no scrolling. The PDF's is
   see-through rather than hidden: html2canvas writes each SVG's computed
   style into it, and an inherited visibility: hidden would blank them all. */
.nl-export, .nl-print { position: fixed; left: 0; top: 0; pointer-events: none; z-index: -1; }
.nl-export { opacity: 0; }
.nl-print { visibility: hidden; }
.nl-print-only { display: none; }

@media print {
    @page { size: A4 portrait; margin: 0; }
    html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    body > *:not(.nl-print) { display: none !important; }
    /* z-index back to auto: body is a flex box, and a flex item's -1 would
       paint it under the body's white. */
    .nl-print { position: static; visibility: visible; z-index: auto; }
    .nl-print .nl-page { page-break-after: always; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .nl-print .nl-page:last-child { page-break-after: auto; break-after: auto; }
}
