/* Create By Asking: wedding invitation maker (projects/wedding-invitation-maker) and the guest page (invite/).
   Loaded after style.css and tools.css on the maker page; the guest page uses only the .iv rules at the bottom. */

/* ---------- maker ---------- */
.wi { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; gap: 26px; }
.wi-form { order: 1; display: grid; gap: 10px; min-width: 0; }
.wi-out { order: 2; display: grid; gap: 14px; min-width: 0; }
.wi label { display: grid; gap: 6px; font-size: var(--step--1); color: #CBBFE8; }
.wi label small { color: #A597CC; font-size: 0.74rem; }
.wi input[type="text"], .wi input[type="email"], .wi input[type="tel"], .wi input[type="url"], .wi input[type="date"], .wi input[type="time"], .wi select, .wi textarea { width: 100%; }
.wi textarea { background: rgba(255, 255, 255, 0.08); border: 1.5px solid transparent; color: #fff; border-radius: 10px; padding: 10px 12px; font: inherit; min-width: 0; resize: vertical; line-height: 1.4; }
.wi textarea:focus { outline: none; border-color: #FFC93C; }
.wi textarea::placeholder { color: #A597CC; }
.wi input[type="date"], .wi input[type="time"] { color-scheme: dark; min-height: 44px; }
.wi-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.wi-two-r { grid-template-columns: minmax(0, 1fr) 120px; }
.wi-sec { background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 0 14px; }
.wi-sec[open] { padding-bottom: 14px; }
.wi-sec > summary { cursor: pointer; list-style: none; padding: 13px 0; font: 700 0.95rem/1.2 var(--body); color: #fff; display: flex; justify-content: space-between; align-items: center; }
.wi-sec > summary::-webkit-details-marker { display: none; }
.wi-sec > summary::after { content: "+"; font: 600 1.2rem/1 var(--body); color: #FFC93C; }
.wi-sec[open] > summary::after { content: "–"; }
.wi-sec[open] > :not(summary) + * { margin-top: 12px; }
.wi-sec[open] > summary + * { margin-top: 0; }
.wi-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wi-cap { font: 600 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #A597CC; margin-right: 4px; min-width: 64px; }
.wi-form .wi-cap { width: 100%; margin: 2px 0 2px; }
.wi [hidden] { display: none !important; }
.wi .wi-check { display: flex; align-items: center; gap: 8px; color: #F2ECFF; cursor: pointer; }
.wi-check input { width: 18px; height: 18px; accent-color: #FFC93C; flex: none; margin: 0; }
.wi-warn { margin: 0; color: #FFB4A6; font-size: 0.8rem; }
.wi-warn:empty { display: none; }
.wi-private { background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.wi-private p { margin: 0; font-size: 0.8rem; color: #CBBFE8; }
.wi-text-btn { border: 0; background: none; color: #CBBFE8; font: 600 0.8rem/1.3 var(--body); cursor: pointer; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; justify-self: start; text-align: left; }
.wi-text-btn:hover { color: #fff; }

.wi-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wi-sw { position: relative; display: inline-flex; }
.wi-sw input[type="color"] { width: 40px; height: 40px; padding: 0; border: 2px solid rgba(255, 255, 255, 0.25); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.wi-sw input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.wi-sw input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.wi-sw input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.wi-sw button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #3A2A6A; color: #fff; font: 600 0.8rem/1 var(--body); cursor: pointer; padding: 0; }
.wi-sw-add { border: 1.5px dashed rgba(255, 255, 255, 0.3); background: none; color: #CBBFE8; border-radius: 999px; padding: 9px 12px; font: 600 0.78rem/1 var(--body); cursor: pointer; }

.wi-designs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.wi-designs button { border: 0; background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 7px 5px 8px; color: #CBBFE8; font: 600 0.72rem/1.15 var(--body); cursor: pointer; display: grid; gap: 6px; justify-items: center; text-align: center; }
.wi-designs button[aria-pressed="true"] { background: #FFC93C; color: #1C0F3F; }
.wi-designs canvas { width: 100%; max-width: 64px; height: auto; aspect-ratio: 5 / 7; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); background: #fff; }
.wi-pal { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
  background: conic-gradient(var(--a) 0 33%, var(--b) 0 66%, var(--p) 0); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.wi-pal[aria-pressed="true"] { border-color: #FFC93C; box-shadow: 0 0 0 2px var(--screen), 0 0 0 4px #FFC93C; }
.wi-own { margin-left: 2px; }
.wi-custom { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wi-custom label { font-size: 0.72rem; justify-items: center; text-align: center; }
.wi-custom input[type="color"] { width: 100%; max-width: 54px; height: 36px; border: 0; border-radius: 8px; padding: 0; background: none; cursor: pointer; }
.wi-font { font-size: 1rem; padding: 6px 13px; }
.wi-font[data-font="classic"], .wi-font[data-font="flowing"], .wi-font[data-font="romantic"] { font-size: 1.25rem; padding: 4px 13px; font-weight: 400; }
.wi-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.wi-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.wi-stage { background: rgba(255, 255, 255, 0.05); border-radius: 14px; padding: 18px; display: grid; justify-items: center; }
.wi-stage canvas { width: 100%; max-width: 520px; height: auto; border-radius: 3px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5); background: #fff; }
.wi-incl { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.wi-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.wi-actions .btn, .wi-pdf .btn { justify-content: center; }
.wi-pdf { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.wi-pdf label { flex: 1 1 260px; }
.wi-pdf select { width: 100%; }
.wi-msg { margin: 0; color: #FFE08F; font-size: 0.85rem; }
.wi-msg:empty { display: none; }
.wi-share { background: rgba(255, 201, 60, 0.1); border: 1.5px solid rgba(255, 201, 60, 0.4); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.wi-share[hidden] { display: none; }
.wi-share p { margin: 0; font-size: 0.88rem; color: #F2ECFF; }
.wi-share .tool-note { font-size: 0.78rem; color: #CBBFE8; }
.wi-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.wi-link input { width: 100%; font: 0.8rem/1.2 var(--mono); }
.wi-share-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.wi-peek { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; border: 0; border-radius: 999px; padding: 12px 18px; background: #FFC93C; color: #1C0F3F; font: 700 0.9rem/1 var(--body); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); cursor: pointer; }
@media (max-width: 1100px) { .wi-designs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 920px) {
  .wi { grid-template-columns: minmax(0, 1fr); }
  .wi-out, .wi-form { order: 0; }
}
@media (max-width: 560px) {
  .wi-stage { padding: 10px; }
  .wi-custom { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wi-actions .btn { flex: 1 1 100%; }
  .wi-pdf .btn { flex: 1 1 100%; }
  .wi-cap { min-width: 0; width: 100%; }
}

/* ---------- guest page ---------- */
.iv { --pp: #FBF6EC; --pi: #3E2B2A; --pa: #6E1E2C; --pg: #C2A26A; --bg: #EFE7DA; --env: #E9DCC8; --env2: #DCCBB3; --pa-l: #9a4a58; --pa-d: #4a1420; --line: rgba(0, 0, 0, 0.2); --soft: rgba(255, 255, 255, 0.6); --tint: #fbf3f4;
  margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, var(--pp), var(--bg) 70%); background-attachment: fixed; color: var(--pi);
  font: 500 1.05rem/1.5 "Cormorant Garamond", Georgia, serif; -webkit-font-smoothing: antialiased; }
.iv * { box-sizing: border-box; }
.iv-main { max-width: 560px; margin: 0 auto; padding: 28px 16px 40px; display: grid; gap: 22px; justify-items: center; }
.iv-env { position: relative; width: min(100%, 440px); aspect-ratio: 7 / 5; margin-top: 12vh; perspective: 1200px; cursor: pointer; border: 0; padding: 0; background: none; color: inherit; font: inherit; }
.iv-env-back { position: absolute; inset: 0; background: var(--env); border-radius: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22); }
.iv-env-front { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; }
.iv-env-front::before, .iv-env-front::after { content: ""; position: absolute; bottom: 0; width: 72%; height: 100%; background: var(--env2); }
.iv-env-front::before { left: 0; clip-path: polygon(0 0, 100% 50%, 100% 100%, 0 100%); }
.iv-env-front::after { right: 0; clip-path: polygon(100% 0, 0 50%, 0 100%, 100% 100%); }
.iv-env-flap { position: absolute; left: 0; right: 0; top: 0; height: 50%; transform-origin: 50% 0; transition: transform 0.7s ease; z-index: 3; }
.iv-env-flap::before { content: ""; position: absolute; inset: 0; background: var(--env2); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: brightness(0.96); }
.iv-seal { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; z-index: 4; display: grid; place-items: center;
  background: radial-gradient(circle at 38% 32%, var(--pa-l), var(--pa) 55%, var(--pa-d));
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), inset 0 0 0 5px var(--pa-d); color: var(--pp);
  font: 400 1.6rem/1 "Pinyon Script", cursive; transition: opacity 0.4s; }
.iv-env-to { position: absolute; left: 0; right: 0; bottom: 7%; z-index: 4; text-align: center; display: grid; gap: 2px; transition: opacity 0.4s; }
.iv-env-to b { font: 400 clamp(1.6rem, 6vw, 2.2rem)/1.1 "Pinyon Script", cursive; color: var(--pa); }
.iv-env-to span { font: 500 0.72rem/1 "Cinzel", Georgia, serif; letter-spacing: 0.22em; text-transform: uppercase; }
.iv-tap { font: 500 0.75rem/1 "Cinzel", Georgia, serif; letter-spacing: 0.2em; text-transform: uppercase; color: var(--pi); opacity: 0.75; animation: iv-pulse 2s ease-in-out infinite; }
@keyframes iv-pulse { 50% { opacity: 0.35; } }
.iv.is-open .iv-env-flap { transform: rotateX(180deg); }
.iv.is-open .iv-seal, .iv.is-open .iv-env-to, .iv.is-open .iv-tap { opacity: 0; }
.iv.is-open .iv-env { animation: iv-away 0.6s 0.55s ease forwards; pointer-events: none; }
@keyframes iv-away { to { transform: translateY(30px); opacity: 0; } }
.iv.is-shown .iv-env, .iv.is-shown .iv-tap { display: none; }
.iv-cards { display: grid; gap: 22px; width: 100%; justify-items: center; }
.iv-cards img, .iv-cards canvas { width: 100%; max-width: 520px; height: auto; border-radius: 3px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2); opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.iv.is-shown .iv-cards img, .iv.is-shown .iv-cards canvas { opacity: 1; transform: none; }
.iv-actions { display: grid; gap: 10px; width: min(100%, 520px); }
.iv-actions[hidden] { display: none; }
.iv-count { text-align: center; font: 500 0.8rem/1.3 "Cinzel", Georgia, serif; letter-spacing: 0.18em; text-transform: uppercase; color: var(--pa); margin: 4px 0; }
.iv-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px; border-radius: 999px; border: 1.5px solid var(--pa); background: transparent; color: var(--pa);
  font: 600 1.05rem/1.2 "Cormorant Garamond", Georgia, serif; letter-spacing: 0.02em; text-decoration: none; cursor: pointer; text-align: center; }
.iv-btn-main { background: var(--pa); color: var(--pp); }
.iv-btn:focus-visible { outline: 3px solid var(--pg); outline-offset: 2px; }
.iv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.iv-sub { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--soft); }
.iv-sub[hidden] { display: none; }
.iv-sub p { margin: 0; text-align: center; font-size: 0.95rem; }
.iv-foot { margin-top: 18px; text-align: center; font: 500 0.82rem/1.5 "Jost", Arial, sans-serif; color: var(--pi); opacity: 0.8; }
.iv-foot a { color: inherit; }
.iv-bad { margin-top: 20vh; text-align: center; max-width: 30em; }
.iv-sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.45); display: grid; align-items: end; justify-items: center; padding: 0; }
.iv-sheet[hidden] { display: none; }
.iv-form { width: min(100%, 520px); max-height: 92vh; overflow: auto; background: var(--pp); color: var(--pi); border-radius: 20px 20px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.iv-form h2 { margin: 0; text-align: center; font: 400 2.1rem/1.1 "Pinyon Script", cursive; color: var(--pa); }
.iv-form label, .iv-form fieldset { display: grid; gap: 6px; font: 600 0.95rem/1.3 "Cormorant Garamond", Georgia, serif; border: 0; padding: 0; margin: 0; }
.iv-form legend { padding: 0; margin-bottom: 6px; }
.iv-form input, .iv-form select, .iv-form textarea { width: 100%; font: 500 1.05rem/1.3 "Cormorant Garamond", Georgia, serif; color: #2b2523; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.iv-form input:focus, .iv-form select:focus, .iv-form textarea:focus { outline: none; border-color: var(--pa); }
.iv-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.iv-choice label { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); cursor: pointer; background: #fff; color: #2b2523; }
.iv-choice input { width: 18px; height: 18px; accent-color: var(--pa); margin: 0; flex: none; }
.iv-choice label:has(input:checked) { border-color: var(--pa); background: var(--tint); }
.iv-err { margin: 0; color: #B3261E; font-size: 0.95rem; text-align: center; }
.iv-err:empty { display: none; }
@media (min-width: 600px) { .iv-sheet { align-items: center; padding: 16px; } .iv-form { border-radius: 20px; } }
.iv-btn[hidden], .iv-pair [hidden] { display: none; }
.iv-form [data-yes-only] { display: grid; gap: 14px; }
.iv-form [data-yes-only][hidden], .iv-form [hidden] { display: none; }
.iv-priv { margin: 0; font-size: 0.9rem; line-height: 1.35; text-align: center; opacity: 0.85; }
.iv-priv:empty { display: none; }
