/* Gift cards: the card itself (shared by app.html and gift.html), the in-app
   Gift page, the "Got a gift code?" box, and the public claim page.
   Colours come from tokens.css so light and dark both work. The card is the
   one exception: like a printed card, it keeps its own colours in both. */

/* ==================== THE CARD ==================== */
.gc {
  --gc-bg: #24263A; --gc-a: #7A5BC0; --gc-b: #3B2E66; --gc-ink: #F4F2FA;
  --gc-soft: rgba(244, 242, 250, .72); --gc-line: rgba(244, 242, 250, .18);
  /* No overflow:hidden — with aspect-ratio that would clip a long message
     instead of letting the card grow. The glow rounds its own corners. */
  position: relative; isolation: isolate;
  /* Card proportions when the content fits; taller when a long message
     needs the room, rather than clipping it. */
  aspect-ratio: 1.58 / 1;
  display: flex; flex-direction: column;
  padding: 20px 22px 18px; border-radius: 14px;
  background: var(--gc-bg); color: var(--gc-ink);
  box-shadow: 0 24px 48px -24px rgba(20, 18, 40, .55), inset 0 0 0 1px var(--gc-line);
  font-family: var(--sans);
}
.gc-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit; overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--gc-a) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, var(--gc-b) 0%, transparent 60%);
  opacity: .9;
}
.gc > * { flex-shrink: 0; }
.gc-top { display: flex; align-items: center; justify-content: space-between; }
.gc-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 750; font-size: 13px;
  letter-spacing: -.01em; }
.gc-mark { width: 18px; height: 18px; border-radius: 50%; background: var(--gc-ink); color: var(--gc-bg);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
.gc-emoji { font-size: 24px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
.gc-hello { margin-top: 14px; font-size: 13px; font-weight: 550; color: var(--gc-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-plan { font-size: 27px; font-weight: 750; letter-spacing: -.025em; line-height: 1.1; margin-top: 3px; }
.gc-meta { font-size: 11.5px; line-height: 1.5; color: var(--gc-soft); margin-top: 6px; }
.gc-msg { font-size: 12.5px; line-height: 1.5; margin-top: 10px; font-style: italic;
  white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gc-msg-empty { opacity: .45; }
.gc-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 12px; }
.gc-from { font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.gc-code { font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em; padding: 6px 8px; border-radius: 5px;
  background: rgba(0, 0, 0, .22); border: 1px dashed var(--gc-line); white-space: nowrap; }
.gc-stamp { position: absolute; right: 18px; top: 50%; transform: translateY(-50%) rotate(-12deg);
  padding: 6px 14px; border: 2px solid var(--gc-ink); border-radius: 6px;
  font-weight: 800; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }

/* Themes. Deep base, two soft glows. Nothing loud — it should look like a
   card someone would actually send. */
.gc-diwali    { --gc-bg: #2A1B12; --gc-a: #E08A1E; --gc-b: #7A2E12; }
.gc-christmas { --gc-bg: #10261E; --gc-a: #B3343E; --gc-b: #1E5A3E; }
.gc-new_year  { --gc-bg: #121A33; --gc-a: #3D7FD0; --gc-b: #8C6A1E; }
.gc-birthday  { --gc-bg: #2B1530; --gc-a: #D0548E; --gc-b: #5B3AA6; }
.gc-plain     { --gc-bg: #24263A; --gc-a: #7A5BC0; --gc-b: #2E3D6B; }
/* Diwali gets a scatter of tiny lights. */
.gc-diwali .gc-glow::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 22%, #FFD27A 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 12%, #FFE3A8 50%, transparent 51%),
    radial-gradient(2px 2px at 58% 18%, #FFC45C 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 30%, #FFE3A8 50%, transparent 51%),
    radial-gradient(2px 2px at 90% 64%, #FFD27A 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 88%, #FFC45C 50%, transparent 51%);
  opacity: .8;
}
.gc-new_year .gc-glow::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 66% 14%, #F6D47A 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 46%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 36% 72%, #F6D47A 50%, transparent 51%);
  opacity: .7;
}
.gc-stamped > :not(.gc-stamp):not(.gc-glow) { opacity: .55; }

/* ==================== IN-APP PAGE ==================== */
.wrap:has(#giftCard:not(.hidden)) { max-width: 1060px; }
.gtabs { max-width: 460px; }

.gsend { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.gpreview { position: sticky; top: 20px; }
.gpreview-label { font: 700 10.5px var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; }
.gpreview-note { margin-top: 12px; }
@media (max-width: 900px) {
  .gsend { grid-template-columns: 1fr; }
  .gpreview { position: static; order: -1; max-width: 420px; }
}

.gstep { padding: 18px 0; border-top: 1px solid var(--line); }
.gstep:first-child { border-top: 0; padding-top: 4px; }
.gstep h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650;
  margin-bottom: 12px; }
.gstep h3 i { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--violet-soft); color: var(--violet-ink); font-size: 11.5px; font-weight: 700; }
.gstep label:first-of-type { margin-top: 0; }
.gopt { color: var(--muted); font-weight: 450; }

.gplans-label { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.gplans-label ~ .gplans-label { margin-top: 14px; }
.gplans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
button.gplan {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: var(--paper); color: var(--text); border: 1px solid var(--line);
  padding: 11px 13px; border-radius: var(--r-md); font-weight: 450;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out);
}
.gplan-name { font-weight: 650; font-size: 13.5px; }
.gplan-price { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.gplan-meta { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
button.gplan-on { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet);
  background: color-mix(in srgb, var(--violet) 6%, var(--paper)); }
@media (hover: hover) and (pointer: fine) {
  button.gplan:not(.gplan-on):hover { border-color: var(--line-strong); background: var(--paper); }
}

.gform textarea {
  width: 100%; background: var(--paper); border: 1px solid var(--line-strong); color: var(--text);
  padding: 12px 14px; border-radius: var(--r-sm); font: inherit; font-size: 15px; resize: vertical;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.gform textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.gcount { font-size: 11.5px; color: var(--muted); text-align: right; margin-top: 4px; }
.gcount-low { color: var(--amber); }
.gemail.gbad input { border-color: var(--red); }

label.gcheck, label.gradio { display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-weight: 500; font-size: 13.5px; margin: 12px 0 0; }
label.gcheck input, label.gradio input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 16px;
  accent-color: var(--violet); padding: 0; }
.gwhen { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.gwhen label.gradio { margin-top: 0; }
.gdate { margin-top: 12px; max-width: 280px; }
.gdate input { color-scheme: inherit; }

.gthemes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
button.gtheme {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); color: var(--text); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 550;
}
button.gtheme-on { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
@media (hover: hover) and (pointer: fine) {
  button.gtheme:not(.gtheme-on):hover { background: var(--paper); border-color: var(--line-strong); }
}

.gpay { padding-top: 18px; border-top: 1px solid var(--line); }
.gpay #gPayBtn { min-width: 220px; padding: 14px 24px; font-size: 15px; }
.gpay .hint { max-width: 520px; }

.gnote { background: var(--well); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; font-size: 14px; line-height: 1.6; }

/* paid */
.gpaid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 28px; align-items: start; }
.gpaid-card .gc { animation: gc-in 520ms var(--ease-out) both; }
.gpaid-info h3 { font-size: 19px; margin-bottom: 8px; }
.gpaid-info > p { font-size: 14px; line-height: 1.6; color: var(--text); }
@keyframes gc-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .gpaid { grid-template-columns: 1fr; } .gpaid-card { max-width: 420px; } }

.gcodebox { margin: 16px 0 10px; padding: 14px; border: 1px dashed var(--violet);
  border-radius: var(--r-md); background: var(--violet-soft); }
.gcode-val { display: block; font: 700 19px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em; color: var(--text); word-break: break-all; }
.gcode-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gwa { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; text-decoration: none; color: #fff; background: #1F8F4E; }
@media (hover: hover) and (pointer: fine) { .gwa:hover { background: #187A41; } }

/* my gifts */
.gsent { display: flex; flex-direction: column; }
.gsrow { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.gsrow:first-child { border-top: 0; padding-top: 4px; }
.gsdot { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--well); }
.gsmain { flex: 1; min-width: 0; }
.gstop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.gstop b { font-size: 14.5px; }
.gsemail { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.gspill { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.gspill-done { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.gspill-wait { background: var(--violet-soft); color: var(--violet-ink); }
.gspill-sched { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.gspill-off { background: var(--well); color: var(--muted); }
.gsmeta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.gsdetail { font-size: 13px; margin-top: 4px; }
.gstoggle { margin-top: 8px; padding: 0; }
.gscode { display: none; }
.gsrow-open .gscode { display: block; }
.gsrow-open .gcodebox { margin-top: 10px; }

.gempty { text-align: center; padding: 28px 12px; }
.gempty b { display: block; font-size: 16px; margin-bottom: 6px; }
.gempty p { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }

/* ==================== REDEEM BOX ==================== */
.gredeem { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px;
  background: var(--paper); max-width: 560px; }
.gredeem-head b { display: block; font-size: 14.5px; }
.gredeem-head span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.gredeem-row { display: flex; gap: 8px; margin-top: 12px; }
.gredeem-input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; letter-spacing: .06em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; }
.gredeem-input::placeholder { letter-spacing: .04em; text-transform: none; }
.gredeem-btn { flex: 0 0 auto; }
.gredeem-out { font-size: 13px; margin-top: 8px; }
.gredeem-out:empty { display: none; }
.gok-text { color: var(--green); font-weight: 600; }
.gbad-text { color: var(--red); }
.gredeem-compact { background: transparent; }
.greceived { margin-top: 22px; max-width: 560px; }
.grrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0;
  border-top: 1px solid var(--line); font-size: 13.5px; }
.grrow:first-of-type { border-top: 0; }
.grrow > span { font-size: 18px; }

/* Plans page: redeem box + gift link under the plan cards */
.plans-gift { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px;
  align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.plans-giftlink { font-size: 13.5px; font-weight: 600; color: var(--violet-ink); text-decoration: none;
  max-width: 250px; line-height: 1.5; }
@media (hover: hover) and (pointer: fine) { .plans-giftlink:hover { text-decoration: underline; } }
@media (max-width: 720px) { .plans-gift { grid-template-columns: 1fr; } }

/* ==================== PUBLIC CLAIM PAGE (gift.html) ==================== */
.gl-wrap { width: min(440px, 100%); animation: rise 600ms var(--ease-out) both; }
.gl-wrap h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 650; letter-spacing: -.02em; }
.gl-wrap .sub { color: var(--muted); font-size: 14.5px; margin: 10px 0 22px; line-height: 1.55; }
.gl-card { margin-bottom: 22px; }
.gl-actions { display: flex; flex-direction: column; gap: 10px; }
.gl-actions .btn { margin-top: 0; }
.gl-alt { display: flex; align-items: center; justify-content: center; height: 48px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); text-decoration: none;
  font-weight: 600; font-size: 14.5px; color: var(--text); background: transparent; cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out); }
.gl-alt:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .gl-alt:hover { border-color: var(--violet); color: var(--violet-ink); } }
.gl-who { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 4px; }
.gl-who button { background: none; border: 0; padding: 0; color: var(--violet-ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.gl-fine { font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.55; }
.gl-enter { display: flex; gap: 8px; margin-top: 6px; }
.gl-enter input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; background: var(--paper);
  color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font: 600 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em;
  text-transform: uppercase; }
.gl-enter input::placeholder { text-transform: none; letter-spacing: .02em; font-weight: 450; }
.gl-enter input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.gl-enter .btn { width: auto; padding: 0 22px; height: 48px; margin: 0; }
.gl-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px;
  border-radius: var(--r-md); background: color-mix(in srgb, var(--green) 10%, transparent);
  color: var(--text); font-size: 14px; line-height: 1.55; }
.gl-done b { color: var(--green); }
.gl-skel { height: 240px; border-radius: 14px; background: var(--well);
  animation: gl-pulse 1.2s ease-in-out infinite; }
@keyframes gl-pulse { 50% { opacity: .55; } }
a.gl-btn-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
