@import "tokens.css";
@import "components.css";

/* ============================================================
   Contreras Baby Shower — styles
   Palette:
     page bg      #E4F2FF
     ink          #1c1c1c
     soft ink     #52565c
     label blue   #8aa4bb
     accent       #5c7d99
     field bg     #f4f5f6   field border #cdddec
     card border  #e2e8ee
   ============================================================ */

@font-face {
  font-family: 'Providence Sans';
  src: url('../assets/fonts/Providence-Sans.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Providence Sans';
  src: url('../assets/fonts/Providence-Sans-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  background: var(--color-bg);
  color: var(--color-body);
  font-family: 'Providence Sans', system-ui, sans-serif;
}
html, body, a, button, input, select, label {
  cursor: url('../assets/img/cursor.png') 2 2, auto;
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-strong); }
input, select, button { font-family: inherit; }
::placeholder { color: var(--color-placeholder); }

img { display: block; }

/* ---- keyframes ---- */
@keyframes contentIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes checkPop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }
@keyframes twinkle {
  0%   { transform: translateZ(0) rotate(var(--r, 0deg)) scale(0); opacity: 0; }
  16%  { opacity: 1; }
  50%  { transform: translateZ(0) rotate(calc(var(--r, 0deg) + 6deg)) scale(1); opacity: 1; }
  84%  { opacity: 1; }
  100% { transform: translateZ(0) rotate(calc(var(--r, 0deg) + 12deg)) scale(0); opacity: 0; }
}

/* ---- auto-hide scrollbar ---- */
.scroll-auto { scrollbar-width: none; -ms-overflow-style: none; }
.scroll-auto::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
.scroll-auto.scrolling { scrollbar-width: thin; scrollbar-color: rgba(60,66,73,0.3) transparent; }
.scroll-auto.scrolling::-webkit-scrollbar { width: 8px; }
.scroll-auto.scrolling::-webkit-scrollbar-thumb { background: rgba(60,66,73,0.28); border-radius: 8px; }

/* ============================================================
   Layout shell
   ============================================================ */
.page {
  position: relative;
  min-height: 100vh;
  padding-bottom: 200px;
  overflow-x: hidden;
}

/* ---- background decorations ---- */
.deco { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.deco img { position: absolute; }
.deco--mobile { display: none; }
@media (max-width: 979px) {
  .deco--desktop { display: none; }
  .deco--mobile { display: block; }
}

/* desktop decoration placement */
.d-web-tl   { top: 14px;  left: -14px;  width: 104px; transform: rotate(-20deg); }
.d-burst-o  { top: 33%;   left: -62px;  width: 182px; transform: rotate(-5deg); }
.d-hat      { bottom: 168px; left: -28px; width: 132px; transform: rotate(-2deg); }
.d-web-bl   { bottom: -34px; left: -34px; width: 120px; transform: scaleX(-1) rotate(-12deg); }
.d-web-tr   { top: -38px; right: 24px;   width: 140px; transform: rotate(14deg); }
.d-burst-p  { top: 19%;   right: -86px;  width: 156px; transform: rotate(5deg); }
.d-skull    { top: 56%;   right: -14px;  width: 112px; transform: rotate(6deg); }
.d-web-br   { bottom: 12px; right: -12px; width: 104px; transform: scaleX(-1) rotate(22deg); }

/* mobile decoration placement */
.m-web-tl   { top: -34px; left: -34px;  width: 96px;  transform: rotate(-18deg); }
.m-burst-p  { top: -46px; right: -64px; width: 132px; transform: rotate(6deg); }
.m-burst-o  { top: 48%;   left: -92px;  width: 132px; transform: rotate(-5deg); }
.m-web-r    { top: 34%;   right: -40px; width: 92px;  transform: scaleX(-1) rotate(14deg); }
.m-hat      { bottom: -14px; left: -40px; width: 106px; transform: rotate(-4deg); }
.m-skull    { bottom: -18px; right: -26px; width: 88px; transform: rotate(6deg); }

/* ---- twinkling stars ---- */
.stars { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; transform: translateZ(0); will-change: transform; }
.star { position: absolute; height: auto; pointer-events: none; will-change: transform, opacity; backface-visibility: hidden; transform: translateZ(0); }
@media (prefers-reduced-motion: reduce) { .star { display: none; } }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; text-align: center; padding: 96px 0 48px; }
.hero__pumpkin { width: min(150px, 40vw); height: auto; margin: 0 auto 24px; animation: contentIn 0.6s ease-out 0.45s both; }
.hero__title { animation: contentIn 0.6s ease-out 0.6s both; }
.hero__date { margin-top: 24px; animation: contentIn 0.6s ease-out 0.75s both; }
.hero__sub { margin-top: 2px; animation: contentIn 0.6s ease-out 0.88s both; }

/* ---- description / note ---- */
.note { max-width: 640px; margin: 0 auto; padding-bottom: 96px; text-align: center; animation: contentIn 0.6s ease-out 1s both; }
.note__p { margin-bottom: 24px; }
.note__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }

/* shared side padding (bigger on mobile so decorations don't crowd copy) */
.pad-x { padding-left: 24px; padding-right: 24px; }
@media (max-width: 979px) { .pad-x { padding-left: 60px; padding-right: 60px; } }
@media (max-width: 979px) { .hero { padding-top: 48px; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); font-size: var(--text-button); line-height: 1; letter-spacing: var(--tracking-btn);
  text-transform: uppercase; font-weight: 700; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--color-ink); transition: background var(--dur-fast) ease, color var(--dur-fast) ease, transform .1s ease;
}
.btn span, .btn svg { line-height: 1; }
.btn svg { display: block; }
.btn--primary { background: var(--color-ink); color: var(--color-surface); padding: 15px 30px 13px; }
.btn--primary:hover { background: var(--color-btn-hover); }
.btn--primary:active { background: var(--color-btn-active); transform: translateY(1px); }
.btn--primary:disabled { cursor: default; background: var(--color-disabled); border-color: var(--color-disabled); color: var(--color-surface); }
.btn--primary:disabled:hover { background: var(--color-disabled); }

.btn--secondary { background: var(--color-surface); color: var(--color-ink); padding: 15px 40px 13px; letter-spacing: var(--tracking-btn-sec); }
.btn--secondary:hover { background: var(--color-ink); color: var(--color-surface); }
.btn--secondary:active { background: var(--color-btn-active); color: var(--color-surface); transform: translateY(1px); }

.btn--min150 { min-width: 150px; }
.btn--min190 { min-width: 190px; }
.btn--min220 { min-width: 220px; }
.btn--block { width: 100%; padding: 18px 16px 16px; }
.btn--sm { padding: 10px 22px 8px; font-size: var(--text-body-sm); }

.linklike { background: none; border: none; cursor: pointer; }

/* ============================================================
   Floating bottom bar
   ============================================================ */
.bar {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 14px 14px 12px; background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--color-field-border); border-radius: var(--radius-bar);
  box-shadow: var(--shadow-bar);
}
.bar__col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bar__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bar__status { display: flex; align-items: center; gap: 9px; }

/* ---- peeking ghost ---- */
.ghost {
  position: fixed; bottom: 22px; left: calc(50% - 82px); width: 104px; height: auto; z-index: 54;
  transform: translate(-50%, 0); pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(40,55,70,0.2));
  clip-path: inset(-30px -30px 0 -30px);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1);
}
.ghost.up { transform: translate(-50%, -62%); transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.ghost.down { transform: translate(-50%, 0); transition: transform .3s linear; }
@keyframes ghostBob {
  0%, 22%, 62%, 100% { transform: translate(-50%, 0); }
  42% { transform: translate(-50%, -20%); }
  78% { transform: translate(-50%, -62%); }
  90% { transform: translate(-50%, -62%); }
}
@media (max-width: 639px) {
  .ghost { animation: ghostBob 6s ease-in-out infinite; transition: none; }
}
@media (prefers-reduced-motion: reduce) { .ghost { animation: none; } }

/* ============================================================
   Modals (RSVP + email lookup)
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto; background: rgba(40,55,70,0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 1; transition: opacity .45s ease; animation: overlayIn .45s ease;
}
.overlay.fade-out { opacity: 0; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.modal {
  position: relative; background: var(--color-surface); border: 1px solid var(--color-card-border); border-radius: var(--radius-modal);
  padding: 48px 44px 44px; width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-modal); transition: opacity .45s ease, transform .45s ease;
}
.modal--sm { width: 480px; padding: 44px 44px 40px; }
.overlay.fade-out .modal { opacity: 0; transform: scale(0.97); }
@media (min-width: 640px) { .modal { animation: modalIn .45s cubic-bezier(.16,1,.3,1); } }
@media (max-width: 639px) {
  .overlay { padding: 0; align-items: stretch; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; animation: none; transition: background .45s ease; }
  .overlay.in { background: rgba(40,55,70,0.5); }
  .modal { width: 100%; border: none; border-radius: 0; min-height: 100vh; max-height: none; padding: 72px 22px 48px; animation: none; transform: translateY(100%); transition: transform .6s cubic-bezier(.16,1,.3,1); }
  .overlay.in .modal { transform: translateY(0); }
}
@keyframes modalSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes overlayBgIn { from { background: transparent; } to { background: rgba(40,55,70,0.5); } }
@keyframes modalSlideDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
.modal__close { position: absolute; top: 18px; right: 18px; z-index: 2; }
.modal__head { text-align: center; margin-bottom: 30px; }
.eyebrow { margin-bottom: 12px; }
.modal--sm .modal__title { font-size: clamp(30px, 6vw, 44px); }
.modal__sub { margin-top: 12px; }

/* ---- form ---- */
.field { display: block; margin-bottom: 20px; }
.field__label { display: block; margin-bottom: 8px; }
.input {
  width: 100%; padding: 13px 15px; border: 1px solid var(--color-field-border); border-radius: var(--radius-field);
  font-size: 16px; color: var(--color-ink); background: var(--color-field); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--color-accent); box-shadow: var(--focus-ring); }
.input::placeholder { color: var(--color-placeholder); }

.plusones { margin-bottom: 22px; }
.plusones__label { display: block; margin-bottom: 10px; }
.plusone { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.plusone .input { flex: 1; }
.plusone__remove {
  flex: none; width: 48px; border: 1px solid var(--color-field-border); border-radius: var(--radius-field); background: var(--color-surface);
  color: var(--color-label); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.plusone__remove:hover { background: var(--color-field); color: var(--color-accent); }
.addplus {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px;
  background: var(--color-field); border: 1.5px dashed var(--color-field-border); border-radius: var(--radius-md); cursor: pointer;
  color: var(--color-hint); font-family: var(--font-body); font-size: var(--text-body-md); font-weight: 400;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.addplus:hover { background: var(--blue-50); border-color: var(--color-accent); color: var(--color-accent); }
.addplus__icon { width: 26px; height: 26px; border: 1.5px dashed currentColor; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }

.submit-inner { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.check { animation: checkPop .35s ease-out; }
.declined { text-align: center; margin-top: 16px; }
.lookup-error { text-align: center; margin-top: 14px; }

/* ============================================================
   Confirmation page
   ============================================================ */
.confirm {
  position: fixed; inset: 0; z-index: 150; background: var(--color-bg); overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px 80px;
  scrollbar-gutter: stable both-edges;
}
.confirm__inner { width: 100%; max-width: 560px; }
.confirm__head { text-align: center; margin-bottom: 26px; }
.confirm__head img { width: 96px; height: auto; margin: 0 auto 18px; }
.confirm__title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-h2); color: var(--color-ink); line-height: 1.02; }
.card { background: var(--color-surface); border: 1px solid var(--color-card-border); border-radius: var(--radius-card); padding: 34px; box-shadow: var(--shadow-card); }
.card + .card { margin-top: 22px; }
.detail { text-align: left; }
.detail__label { margin-top: 32px; margin-bottom: 6px; }
.detail__label:first-child { margin-top: 0; }
.detail__value { font-family: var(--font-display); font-size: var(--text-h3); color: var(--color-ink); line-height: 1.3; margin-bottom: 20px; }
.detail__h { font-family: var(--font-display); font-size: var(--text-h4); font-weight: 700; color: var(--color-ink); margin: 36px 0 10px; }
.detail__p { font-size: var(--text-body-md); color: var(--color-muted); line-height: 1.6; margin-bottom: 20px; }
.detail__p a { color: var(--color-accent); text-decoration: underline; }
.maps { display: flex; gap: 12px; margin-bottom: 24px; }
.maps .btn { flex: 1; gap: 9px; }
@media (max-width: 639px) {
  .maps { flex-direction: column; }
  .maps .btn { width: 100%; }
}
.maps svg { flex: none; }

.whos { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.whos__title { font-family: var(--font-display); font-size: var(--text-h3); color: var(--color-ink); font-weight: 700; }
.guest { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--color-card-border); }
.guest__main { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.guest__names { font-size: var(--text-body-md); color: var(--color-ink); font-weight: 400; text-align: left; }
.guest__email { font-size: 13px; color: var(--color-label); }
.guest__party { flex: none; font-size: 13px; color: var(--color-muted); }
.center { display: block; margin: 26px auto 0; }

/* ============================================================
   Admin dashboard (admin.html)
   ============================================================ */
.admin-wrap { max-width: 560px; margin: 0 auto; padding: 60px 20px 40px; }
.admin-card { background: var(--color-surface); border: 1px solid var(--color-card-border); border-radius: var(--radius-card); padding: 40px 34px; box-shadow: var(--shadow-card); }
.admin-title { line-height: 1.02; }
.admin-sub { margin: 6px 0 24px; }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.admin-empty { font-size: var(--text-body-sm); color: var(--color-muted); padding: 8px 0; }

[hidden] { display: none !important; }
