/* /gift, /gift/open and /gift/status. --accent and --hero follow the chosen occasion. */
:root {
  --bg: #0f1419; --panel: #171e27; --panel-2: #1f2833; --line: #2d3845; --ink: #f3f4f6; --muted: #9ca3af;
  --accent: #4f46e5; --hero: #312e81; --ok: #34d399; --err: #fca5a5; --radius: 14px;
}
* { box-sizing: border-box; }
/* .gf-btn and friends set display, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 6px; }
/* Headings take focus only so screen readers follow each step: nothing to activate. */
h2[tabindex="-1"]:focus { outline: none; }
.gf-nav { display: flex; justify-content: space-between; align-items: center; max-width: 1240px; margin: 0 auto; padding: 16px 20px; }
.gf-nav img { height: 44px; display: block; }
.gf-nav-link { color: var(--muted); text-decoration: none; font-size: 15px; }
.gf-nav-link:hover { color: #fff; }

.gf-hero { text-align: center; max-width: 760px; margin: 0 auto; padding: 22px 20px 30px; }
.gf-hero h1 { font-size: clamp(32px, 6vw, 54px); font-weight: 800; }
.gf-hero p { color: var(--muted); font-size: clamp(16px, 2.4vw, 19px); margin: 14px 0 0; }

.gf-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 32px; max-width: 1240px; margin: 0 auto; padding: 0 20px 70px; align-items: start; }
.gf-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 30px); }

.gf-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 24px; padding: 0; }
.gf-steps li { flex: 1; min-width: 0; }
.gf-steps button { width: 100%; background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; }
.gf-steps button:disabled { cursor: default; }
.gf-steps .bar { display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 7px; transition: background .25s; }
.gf-steps .done .bar, .gf-steps .current .bar { background: var(--accent); }
.gf-steps .current button { color: #fff; }

.gf-step { display: none; }
.gf-step.is-active { display: block; animation: gf-in .28s ease; }
@keyframes gf-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gf-step h2 { font-size: 25px; font-weight: 800; }
.gf-step > p.lead { color: var(--muted); margin: 6px 0 20px; }

.gf-packs { display: grid; gap: 12px; }
.gf-pack { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; transition: border-color .15s, transform .15s; }
.gf-pack:hover { border-color: #4b5a6b; }
.gf-pack:has(input:checked), .gf-theme:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.gf-pack input, .gf-theme input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gf-pack:has(input:focus-visible), .gf-theme:has(input:focus-visible) { outline: 3px solid #fff; outline-offset: 2px; }
.gf-pack-credits { font-size: 28px; font-weight: 800; line-height: 1; text-align: center; min-width: 62px; }
.gf-pack-credits small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .05em; margin-top: 4px; }
.gf-pack-name { font-weight: 700; }
.gf-pack-blurb { color: var(--muted); font-size: 14px; line-height: 1.35; }
.gf-pack-price { font-size: 21px; font-weight: 800; white-space: nowrap; text-align: right; }
.gf-pack-price small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }

.gf-hero-link { font-size: 15px !important; margin-top: 10px !important; }
.gf-hero-link a { color: #c7d2fe; font-weight: 600; }
.gf-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gf-method { position: relative; display: block; padding: 20px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; transition: border-color .15s; }
.gf-method:hover { border-color: #4b5a6b; }
.gf-method:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.gf-method:has(input:focus-visible) { outline: 3px solid #fff; outline-offset: 2px; }
.gf-method input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gf-method-icon { display: block; font-size: 32px; line-height: 1.2; margin-bottom: 8px; }
.gf-method-title { display: block; font-size: 18px; font-weight: 800; margin-bottom: 5px; }
.gf-method-text { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
.gf-optional { font-weight: 400; color: var(--muted); }
.gf-print-only { display: none; }
.gf-is-print .gf-print-only { display: inline; }
.gf-is-print .gf-email-only { display: none; }
.gf-code-input { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .04em; }
.gf-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
.gf-theme { position: relative; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--panel-2); }
.gf-theme-art { display: block; height: 72px; font-size: 34px; line-height: 72px; text-align: center; background-size: cover; background-position: center; }
.gf-theme-name { display: block; padding: 9px 8px; font-size: 14px; font-weight: 600; text-align: center; }

.gf-field { margin-bottom: 16px; }
.gf-field label, .gf-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.gf-field input[type=text], .gf-field input[type=email], .gf-field input[type=password], .gf-field input[type=date], .gf-field textarea { width: 100%; background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 13px; font-size: 16px; }
.gf-field input:focus, .gf-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.gf-field textarea { min-height: 130px; resize: vertical; }
.gf-field input[type=date] { color-scheme: dark; }
.gf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gf-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gf-count { color: var(--muted); font-size: 13px; }
.gf-link { background: none; border: 0; padding: 0; color: #c7d2fe; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.gf-help { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.gf-err { color: var(--err); font-size: 14px; margin: 5px 0 0; }
.gf-err:empty { display: none; }
.gf-invalid { border-color: var(--err) !important; }

.gf-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.gf-choice label { display: block; border: 2px solid var(--line); border-radius: 10px; padding: 11px 13px; text-align: center; cursor: pointer; font-weight: 600; background: var(--panel-2); }
.gf-choice label:has(input:checked) { border-color: var(--accent); }
.gf-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.gf-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; align-items: center; }
.gf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; background: var(--accent); color: #fff; border: 0; border-radius: 11px; padding: 12px 24px; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; transition: filter .15s, transform .1s; }
.gf-btn:hover { filter: brightness(1.12); }
.gf-btn:active { transform: translateY(1px); }
.gf-btn:disabled { opacity: .6; cursor: progress; }
.gf-btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.gf-btn.wide { width: 100%; }

.gf-summary { list-style: none; margin: 0 0 18px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.gf-summary li { display: flex; justify-content: space-between; gap: 18px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.gf-summary li:last-child { border-bottom: 0; }
.gf-summary span:first-child { color: var(--muted); flex-shrink: 0; }
.gf-summary span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.gf-confirm-addr { background: var(--panel-2); border-radius: 10px; padding: 12px 14px; font-size: 15px; margin-bottom: 18px; overflow-wrap: anywhere; }
#gift-checkout { background: #fff; border-radius: var(--radius); margin-top: 18px; }
#gift-checkout[hidden] { display: none; }

.gf-preview-wrap { position: sticky; top: 16px; }
.gf-preview-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.gf-mail { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.gf-mail-bar { background: #e5e7eb; color: #374151; padding: 9px 13px; font-size: 13px; overflow-wrap: anywhere; }
.gf-mail iframe { display: block; width: 100%; height: min(72vh, 760px); border: 0; background: #f3f4f6; }
.gf-preview-toggle { display: none; }

.gf-success { text-align: center; padding: 26px 6px; }
.gf-success-mark { font-size: 58px; line-height: 1; }
.gf-success h2 { font-size: 30px; margin: 12px 0 8px; font-weight: 800; }
.gf-success p { color: var(--muted); margin: 0 auto 20px; max-width: 480px; }
.gf-success-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.gf-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 1240px; margin: 0 auto; padding: 0 20px 60px; }
.gf-trust div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.gf-trust h3 { font-size: 16px; margin-bottom: 5px; }
.gf-trust p { color: var(--muted); font-size: 14px; margin: 0; }

.gf-toasts { position: fixed; right: 16px; bottom: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 60; pointer-events: none; }
.gf-toast { background: #111827; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px; padding: 12px 16px; font-size: 15px; animation: gf-in .2s ease; max-width: 420px; }
.gf-toast.err { border-left-color: var(--err); }
.gf-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: none; align-items: center; justify-content: center; padding: 14px; z-index: 50; }
.gf-modal.is-open { display: flex; }
.gf-modal-box { background: var(--panel); border-radius: 16px; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.gf-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.gf-modal-box iframe { width: 100%; height: 76vh; border: 0; background: #f3f4f6; }

/* The unwrap page */
.gf-open { max-width: 620px; margin: 0 auto; padding: 10px 16px 60px; }
.gf-box { position: relative; width: 150px; height: 130px; margin: 18px auto 8px; }
.gf-box-base, .gf-box-lid { position: absolute; left: 50%; transform: translateX(-50%); background: var(--accent); border-radius: 8px; }
.gf-box-base { bottom: 0; width: 124px; height: 90px; }
.gf-box-base::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 20px; margin-left: -10px; background: rgba(255, 255, 255, .85); }
.gf-box-lid { top: 16px; width: 150px; height: 32px; animation: gf-lid 1s .4s cubic-bezier(.3, 1.3, .6, 1) forwards; transform-origin: right bottom; }
.gf-box-lid::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 20px; margin-left: -10px; background: #fff; }
@keyframes gf-lid { to { transform: translate(-50%, -48px) rotate(14deg); opacity: 0; } }
.gf-card { background: #fff; color: #111827; border-radius: 20px; overflow: hidden; opacity: 0; animation: gf-rise .7s 1.1s ease forwards; }
@keyframes gf-rise { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
.gf-card-top { background: var(--hero); color: #fff; text-align: center; padding: 28px 22px; }
.gf-card-top .from { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-top: 6px; overflow-wrap: anywhere; }
.gf-card-top h1 { font-size: clamp(25px, 5vw, 32px); font-weight: 800; margin-top: 6px; overflow-wrap: anywhere; }
.gf-card-body { padding: 24px; }
.gf-card-message { white-space: pre-line; font-size: 17px; color: #374151; margin: 0 0 18px; overflow-wrap: anywhere; }
.gf-card-credits { background: #f3f4f6; border-radius: 12px; text-align: center; padding: 16px; font-size: 25px; font-weight: 800; margin-bottom: 20px; }
.gf-card-credits small { display: block; font-size: 14px; font-weight: 600; color: #4b5563; margin-top: 3px; }
.gf-card .gf-field label { color: #111827; }
.gf-card .gf-field input { background: #fff; color: #111827; border-color: #d1d5db; }
.gf-card .gf-btn.ghost { color: #111827; border-color: #d1d5db; }
.gf-card .gf-err { color: #b91c1c; }
.gf-card .gf-help, .gf-card-note { color: #4b5563; font-size: 14px; }
.gf-card-note { text-align: center; margin: 12px 0 0; }
.gf-card form { margin: 0; }
.gf-card .gf-link { color: #4338ca; }
.gf-or { text-align: center; color: #6b7280; font-size: 14px; margin: 12px 0; }
.gf-stack { display: grid; gap: 10px; }

/* The gifter's status page */
.gf-status { max-width: 680px; margin: 0 auto; padding: 8px 16px 60px; }
.gf-status h1 { font-size: clamp(28px, 5vw, 38px); font-weight: 800; margin-bottom: 18px; }
.gf-timeline { list-style: none; margin: 0 0 20px; padding: 0; }
.gf-timeline li { position: relative; padding: 0 0 20px 32px; color: var(--muted); }
.gf-timeline li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.gf-timeline li::after { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.gf-timeline li:last-child::after { display: none; }
.gf-timeline li.done { color: var(--ink); }
.gf-timeline li.done::before { background: var(--ok); }
.gf-timeline b { display: block; }
.gf-timeline small { color: var(--muted); }
.gf-warning { background: #451a03; border: 1px solid #92400e; color: #fde68a; padding: 13px 15px; border-radius: 10px; margin-bottom: 18px; }

@media (max-width: 960px) {
  .gf-layout { grid-template-columns: minmax(0, 1fr); }
  .gf-preview-wrap { display: none; }
  .gf-preview-toggle { display: inline-flex; width: 100%; margin-top: 12px; }
  .gf-trust { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .gf-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .gf-methods { grid-template-columns: minmax(0, 1fr); }
  .gf-pack { grid-template-columns: minmax(0, 1fr) auto; padding: 14px; }
  .gf-pack-credits { grid-column: 1; text-align: left; display: flex; align-items: baseline; gap: 6px; }
  .gf-pack-credits small { margin: 0; }
  .gf-pack-price { grid-column: 2; grid-row: 1; }
  .gf-pack-info { grid-column: 1 / -1; }
  .gf-steps button { font-size: 11px; }
  .gf-summary li { flex-direction: column; gap: 1px; }
  .gf-summary span:last-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}
