/* Sign maker (/wedding-qr-code-sign). Uses the site tokens from site.css. */

/* Fonts used on the signs only (SIL Open Font License, see /fonts/*-LICENSE.txt). */
@font-face { font-family: "Pinyon Script"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/pinyon-script-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }

/* ------------------------------------------------------------- layout */
.sign-page { --header-h: 87px; } /* header height incl. its 1px border */
.sm-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Desktop: the sign is the hero, pinned on the left; heading and controls scroll on the right. */
.sm-workspace {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, .88fr); grid-template-rows: auto 1fr;
  grid-template-areas: "stage intro" "stage panel"; column-gap: clamp(32px, 4vw, 64px); align-items: start; padding-block: 28px 96px;
}
.sm-intro { grid-area: intro; padding: 18px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.sm-intro h1 { max-width: 560px; margin-bottom: 16px; font-size: clamp(34px, 3.3vw, 50px); line-height: 1.08; }
.sm-lede { max-width: 520px; margin: 0; color: #4f5a53; font-size: 16px; line-height: 1.7; }
.sm-panel { grid-area: panel; }

/* The stage: the sign sits on a softly lit table, shadow and all. */
.sm-stage { grid-area: stage; position: sticky; top: calc(var(--header-h) + 16px); }
.sm-table {
  display: grid; place-items: center; height: min(calc(100vh - var(--header-h) - 74px), 800px); min-height: 460px; padding: 34px;
  border-radius: 18px;
  background:
    radial-gradient(110% 80% at 50% 8%, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, #ebe6dc 0%, #e2dccf 100%);
  box-shadow: inset 0 0 0 1px rgba(32, 43, 38, .06);
}
.sm-sign {
  display: block; max-width: 100%; border-radius: 2px; opacity: 0;
  box-shadow: 0 1px 1px rgba(32, 43, 38, .10), 0 4px 10px -2px rgba(32, 43, 38, .12), 0 26px 46px -18px rgba(32, 43, 38, .38);
  transition: opacity .35s ease;
}
.sm-loaded .sm-sign { opacity: 1; }
.sm-caption { margin: 12px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

/* ------------------------------------------------------------- panel */
.sm-panel { display: grid; gap: 0; }
.sm-group { margin: 0; padding: 0 0 24px; border: 0; }
.sm-group + .sm-group { padding-top: 22px; border-top: 1px solid var(--line); }
.sm-group legend, .sm-qr h2 { display: block; float: left; width: 100%; margin: 0 0 14px; padding: 0; font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: -.02em; line-height: 1.2; }
.sm-group legend + * { clear: both; }

.sm-designs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sm-design { display: grid; justify-items: center; gap: 8px; cursor: pointer; }
.sm-design canvas { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; border-radius: 3px; box-shadow: 0 1px 2px rgba(32, 43, 38, .14), 0 6px 14px -8px rgba(32, 43, 38, .35); transition: transform .25s var(--ease), box-shadow .25s ease; }
.sm-design:hover canvas { transform: translateY(-2px); }
.sm-design input:checked ~ canvas { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--forest); }
.sm-design input:focus-visible ~ canvas { outline: 3px solid var(--clay); outline-offset: 5px; }
.sm-design-name { color: #4f5a53; font-size: 12px; font-weight: 600; }
.sm-design input:checked ~ .sm-design-name { color: var(--ink); }

.sm-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.sm-swatch { cursor: pointer; }
.sm-swatch-chip { display: block; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); box-shadow: inset 0 0 0 1px rgba(32, 43, 38, .12); transition: transform .2s var(--ease), box-shadow .2s ease; }
.sm-swatch:hover .sm-swatch-chip { transform: scale(1.06); }
.sm-swatch input:checked + .sm-swatch-chip { box-shadow: inset 0 0 0 1px rgba(32, 43, 38, .12), 0 0 0 3px var(--paper), 0 0 0 5px var(--forest); }
.sm-swatch input:focus-visible + .sm-swatch-chip { outline: 3px solid var(--clay); outline-offset: 6px; }

.sm-field { display: grid; gap: 7px; margin-bottom: 16px; }
.sm-field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.sm-optional { margin-left: 4px; color: #7c857e; font-weight: 400; }
.sm-field input, .sm-field select, .sm-calc input, .sm-linkbox input {
  width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #d6dad1; border-radius: 8px;
  color: var(--ink); background: #fffefa; font: inherit; font-size: 15px; outline: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sm-field select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, #5d6a61 50%), linear-gradient(135deg, #5d6a61 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.sm-field input:hover, .sm-field select:hover { border-color: #aab6a9; }
.sm-field input:focus, .sm-field select:focus, .sm-calc input:focus, .sm-linkbox input:focus { border-color: #788f7b; box-shadow: 0 0 0 3px rgba(120, 143, 123, .18); }
.sm-field input[aria-invalid="true"] { border-color: #b85d4e; box-shadow: 0 0 0 3px rgba(184, 93, 78, .12); }
.sm-field input[hidden] { display: none; }
.sm-field small { color: #737d75; font-size: 12px; line-height: 1.5; }
#headline-custom { margin-top: 2px; }

.sm-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.sm-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--forest); }

.sm-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sm-size { display: grid; align-content: start; gap: 3px; min-height: 84px; padding: 12px 13px; border: 1px solid #d6dad1; border-radius: 10px; background: rgba(255, 254, 250, .5); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.sm-size:hover { border-color: #aab6a9; }
.sm-size:has(input:checked) { border-color: var(--forest); background: #fffefa; box-shadow: inset 0 0 0 1px var(--forest); }
.sm-size:has(input:focus-visible) { outline: 3px solid var(--clay); outline-offset: 3px; }
.sm-size-label { font-size: 15px; font-weight: 600; }
.sm-size-use { color: #69736b; font-size: 12px; line-height: 1.35; }
.sm-paper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; font-size: 13px; }
.sm-paper > span { color: #59635d; }
.sm-paper label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.sm-paper input { width: 16px; height: 16px; margin: 0; accent-color: var(--forest); }

/* ------------------------------------------------------------- QR step */
.sm-qr { margin-top: 4px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fffefa; box-shadow: 0 18px 40px -30px rgba(32, 43, 38, .45); }
.sm-qr h2 { float: none; }
.sm-qr p { margin: 0 0 16px; color: #4f5a53; font-size: 14px; line-height: 1.6; }
.sm-cta { width: 100%; min-height: 52px; font-size: 13px; }
.sm-cta:disabled { cursor: progress; opacity: .7; transform: none; }
.sm-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 20px; border: 1px solid var(--forest); border-radius: 4px; color: var(--forest); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s ease; }
.sm-secondary:hover { background: rgba(38, 58, 49, .06); }
.sm-secondary:disabled { cursor: progress; opacity: .7; }
.sm-downloads { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 4px; }
.sm-status { min-height: 0; margin: 10px 0 0 !important; font-size: 13px !important; }
.sm-status:empty { display: none; }
.sm-status[data-state="error"] { color: #a3483a !important; }
.sm-status[data-state="ok"] { color: var(--forest) !important; font-weight: 600; }
.sm-fine { margin: 12px 0 0 !important; color: #7c857e !important; font-size: 12px !important; }
.sm-fine a, .sm-opens a, .sm-textlink { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.sm-opens { word-break: break-word; }
.sm-existing { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.sm-keep { margin-top: 18px; padding: 16px; border-radius: 10px; background: #f6ede7; }
.sm-keep p { margin-bottom: 12px; font-size: 13px; }
.sm-linkbox { display: flex; gap: 8px; margin-bottom: 12px; }
.sm-linkbox input { min-width: 0; font-size: 12px; }
.sm-linkbox .sm-secondary { flex: 0 0 auto; min-height: 46px; padding: 0 16px; white-space: nowrap; }
.sm-textlink { font-size: 13px; font-weight: 600; }
.sm-textbtn { margin-top: 16px; padding: 0; border: 0; color: #59635d; background: none; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ------------------------------------------------------------- content below */
.sm-section { padding-block: 72px; border-top: 1px solid var(--line); }
.sm-section h2 { max-width: 640px; margin-bottom: 26px; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.12; }
.sm-section p { max-width: 560px; color: #4f5a53; font-size: 16px; line-height: 1.7; }
.sm-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.sm-steps li { position: relative; padding-top: 58px; color: #4f5a53; font-size: 15px; line-height: 1.7; counter-increment: step; }
.sm-steps li::before { position: absolute; top: 0; left: 0; content: counter(step); color: var(--clay); font-family: var(--serif); font-size: 42px; line-height: 1; }
.sm-steps strong, .sm-tips strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 16px; }
.sm-count { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 48px; align-items: start; }
.sm-calc { display: grid; gap: 10px; padding: 24px; border-radius: 14px; background: #fffefa; box-shadow: inset 0 0 0 1px var(--line); }
.sm-calc label { font-size: 13px; font-weight: 600; }
.sm-calc input { max-width: 160px; }
.sm-calc-result { margin: 4px 0 0; color: var(--ink) !important; font-size: 15px !important; }
.sm-tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 48px; margin: 0; padding: 0; list-style: none; }
.sm-tips li { color: #4f5a53; font-size: 15px; line-height: 1.7; }
.sm-faq { border-top: 1px solid var(--line); }
.sm-faq .faq-intro a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------- smaller screens */
@media (max-width: 1050px) {
  .sign-page { --header-h: 79px; }
  .sm-designs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .sign-page { --header-h: 73px; }
  .sm-workspace { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "intro" "stage" "panel"; row-gap: 18px; padding-top: 10px; }
  .sm-intro { padding: 22px 0 4px; margin-bottom: 0; border-bottom: 0; }
  .sm-intro h1 { font-size: clamp(34px, 8vw, 46px); }
  /* The preview stays pinned above the controls, so every change is visible while typing. */
  .sm-stage { z-index: 20; top: var(--header-h); margin-inline: -20px; padding: 8px 20px 10px; background: var(--paper); box-shadow: 0 10px 18px -16px rgba(32, 43, 38, .5); }
  .sm-table { height: min(44vh, 420px); min-height: 240px; padding: 14px; border-radius: 14px; }
  .sm-caption { margin-top: 6px; font-size: 12px; }
  /* Fields scrolled into view (focus, errors) must land below the pinned preview, not under it. */
  .sm-panel :is(input, select, button, label, .sm-qr) { scroll-margin-top: calc(var(--header-h) + min(44vh, 420px) + 52px); }
  .sm-designs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
  .sm-field input, .sm-field select, .sm-calc input, .sm-linkbox input { font-size: 16px; } /* no zoom on iOS */
  .sm-steps, .sm-tips, .sm-count { grid-template-columns: 1fr; }
  .sm-steps { gap: 22px; }
  .sm-section { padding-block: 56px; }
}

@media (max-width: 560px) {
  .sign-page { --header-h: 69px; }
  .sm-designs { gap: 7px; }
  .sm-design-name { font-size: 11px; }
  .sm-sizes { grid-template-columns: 1fr; }
  .sm-size { min-height: 0; grid-template-columns: auto 1fr; align-items: baseline; gap: 10px; }
  .sm-downloads { grid-template-columns: 1fr; }
  .sm-qr { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sm-sign, .sm-design canvas, .sm-swatch-chip { transition: none; }
}
