/*
 * PlanIt brand system for guest-facing web pages.
 * Source of truth: WEB_BRAND_STYLE_GUIDE.md (keep this file in sync with it).
 * Shared across all 6 guest pages so the look can't drift between them again.
 */

:root {
  --planit-brand: #4E0437;
  --planit-brand-start: #3A032B;
  --planit-brand-end: #701049;
  --planit-background: #FFF7F1;
  --planit-card: #FFFFFF;
  --planit-accent: #FF7F50;
  --planit-success: #4CAF50;
  --planit-warning: #FFA726;
  --planit-error: #E53935;
  --planit-text-dark: #2A2A2A;
  --planit-text-light: #FFFFFF;
  --planit-text-muted: #9E9E9E;

  /* Set per-page via [data-occasion] in planit-occasion.css; falls back to brand maroon. */
  --planit-occasion-accent: var(--planit-brand);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--planit-background);
  color: var(--planit-text-dark);
  font-family: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Soft atmospheric color underneath everything — the flat cream background
   on its own reads generic; two large, blurred, low-opacity blobs in the
   brand/accent colors give the page some depth without competing with
   content. Fixed + behind everything (z-index -1), so it never affects
   layout or scroll. */
body {
  position: relative;
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px circle at 8% -5%, rgba(255, 127, 80, 0.16), transparent 60%),
    radial-gradient(620px circle at 100% 18%, rgba(78, 4, 55, 0.10), transparent 55%),
    radial-gradient(480px circle at 15% 95%, rgba(112, 16, 73, 0.08), transparent 60%);
  pointer-events: none;
}

img { max-width: 100%; }

a { color: var(--planit-brand); }

/* ---------- Typography ---------- */

.planit-title-lg {
  font-size: 20px;
  font-weight: 700;
  color: var(--planit-text-dark);
  margin: 0;
  position: relative;
  padding-left: 14px;
  letter-spacing: -0.01em;
}
/* Small colored accent bar in front of every major card heading — a cheap,
   consistent way to give otherwise-plain section headings some identity. */
.planit-title-lg::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--planit-occasion-accent), var(--planit-accent));
}
.planit-title-md { font-size: 16px; font-weight: 600; color: var(--planit-text-dark); margin: 0; }
.planit-title-sm { font-size: 14px; font-weight: 500; color: var(--planit-text-dark); margin: 0; }
.planit-body-md  { font-size: 14px; font-weight: 400; color: var(--planit-text-dark); margin: 0; }
.planit-body-sm  { font-size: 12px; font-weight: 400; color: var(--planit-text-muted); margin: 0; }

.planit-on-brand .planit-title-lg,
.planit-on-brand .planit-title-md,
.planit-on-brand .planit-title-sm,
.planit-on-brand .planit-body-md {
  color: var(--planit-text-light);
}

/* ---------- Layout ---------- */

.planit-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.planit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 8px;
  max-width: 1080px;
  margin: 0 auto;
}

.planit-brand-lockup { display: flex; align-items: center; gap: 12px; }

.planit-logo {
  width: 44px;
  height: 44px;
  padding: 6px; /* the source logo asset is cropped tight — give it breathing room */
  border-radius: 12px;
  background: var(--planit-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.planit-logo img { width: 100%; height: 100%; object-fit: contain; }

.planit-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .planit-grid { grid-template-columns: 1fr; }
}

.planit-promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.planit-section-title {
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  color: var(--planit-text-dark);
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
/* Small dot instead of a full underline — reads as a deliberate mark, not
   a leftover default heading style. */
.planit-section-title::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--planit-accent);
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.planit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  height: 50px;
  padding: 0 20px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.planit-btn:not(:disabled):not([aria-disabled="true"]):hover { transform: translateY(-1px); }
.planit-btn:active { transform: translateY(1px); }

.planit-btn--small { min-width: 120px; height: 50px; }

.planit-btn--primary {
  background: var(--planit-brand);
  color: #FFF3F8;
  box-shadow: 0 8px 20px rgba(78, 4, 55, 0.22);
}
.planit-btn--primary:hover { box-shadow: 0 10px 24px rgba(78, 4, 55, 0.3); }

.planit-btn--outlined {
  background: var(--planit-card);
  color: var(--planit-brand);
  border: 1px solid var(--planit-brand);
}
.planit-btn--outlined:hover { background: rgba(78, 4, 55, 0.05); }

.planit-btn--accent {
  background: var(--planit-accent);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(255, 127, 80, 0.28);
}
.planit-btn--accent:hover { box-shadow: 0 10px 24px rgba(255, 127, 80, 0.36); }

/* High-contrast CTA for buttons sitting on a colored gradient card (the
   gift-card CTA) — a same-family colored button there would nearly
   disappear into the card background regardless of occasion, so this is
   deliberately white-on-color instead of brand-on-brand. */
.planit-btn--giftcard {
  background: #FFFFFF;
  color: var(--planit-accent);
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}
.planit-btn--giftcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.planit-btn:disabled,
.planit-btn[aria-disabled="true"] {
  background: #E0E0E0;
  color: #757575;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.planit-btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Low-emphasis escape-hatch action (e.g. "Cancel" next to a form's real
   submit button) — deliberately not a .planit-btn so it never competes
   visually with the actual primary action beside it. */
.planit-btn-text {
  background: none;
  border: none;
  padding: 8px 4px;
  color: var(--planit-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.planit-btn-text:hover { color: var(--planit-text-dark); }

@media (max-width: 480px) {
  .planit-btn { width: 100%; }
}

/* ---------- Cards / surfaces ---------- */

.planit-card {
  background: var(--planit-card);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  /* Two-layer shadow — a tight contact shadow plus a soft ambient one reads
     as an actually-lifted surface instead of the flat single-blur default. */
  box-shadow: 0 1px 2px rgba(43, 8, 30, 0.04), 0 10px 28px rgba(43, 8, 30, 0.09);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.planit-card--option {
  border-radius: 16px;
}

/* Cards that are themselves an action (promo tiles, gift/photo entry cards,
   wishlist items) get a gentle lift on hover — the flat cards had zero
   interactivity signal even though most of them are clickable. */
.planit-promo-grid .planit-card:hover,
.planit-gift-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(43, 8, 30, 0.06), 0 18px 36px rgba(43, 8, 30, 0.14);
}

.planit-card--brand {
  background: linear-gradient(135deg, var(--planit-brand-start), var(--planit-brand-end));
  border: none;
  color: var(--planit-text-light);
}

/* ---------- Step flow (numbered stepper + panels) ---------- */

.planit-stepper {
  display: flex;
  align-items: center;
  margin: 20px 0 4px;
}
.planit-step { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.planit-step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #EFEAE8;
  color: var(--planit-text-muted);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.planit-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--planit-text-muted);
  white-space: nowrap;
}
.planit-step.is-active .planit-step-circle {
  background: var(--planit-brand);
  color: #fff;
  transform: scale(1.08);
}
.planit-step.is-active .planit-step-label { color: var(--planit-text-dark); }
.planit-step.is-done .planit-step-circle { background: var(--planit-success); color: #fff; }
.planit-step.is-done .planit-step-label { color: var(--planit-text-dark); }
.planit-step-line {
  flex: 1;
  height: 2px;
  background: #EFEAE8;
  margin: 0 8px;
  min-width: 16px;
  transition: background 0.2s ease;
}
.planit-step-line.is-done { background: var(--planit-success); }

.planit-step-panel { margin-top: 18px; }

/* Compact vertical event summary (used in the photo-upload widget's first
   step) — a horizontal wrap of chips reads as cramped/cluttered once the
   venue name is long; a short vertical stack reads cleanly at any width. */
.planit-event-confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(78, 4, 55, 0.05);
  border-radius: 12px;
}
.planit-event-confirm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--planit-text-dark);
}
.planit-event-confirm-row span:first-child { font-size: 15px; flex-shrink: 0; }
.planit-event-confirm-row:first-child { font-size: 15px; font-weight: 700; }

@media (max-width: 420px) {
  .planit-step-label { display: none; }
  .planit-step-line { margin: 0 4px; }
}

/* ---------- Status badges ---------- */

.planit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.planit-badge--success { background: rgba(76, 175, 80, 0.15); color: var(--planit-success); }
.planit-badge--warning  { background: rgba(255, 167, 38, 0.15); color: var(--planit-warning); }
.planit-badge--error    { background: rgba(229, 57, 53, 0.15); color: var(--planit-error); }

/* ---------- Form controls ---------- */

.planit-field { margin-bottom: 14px; }
.planit-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--planit-text-dark);
}

.planit-input,
.planit-select,
.planit-textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid #E6E6EA;
  font-family: inherit;
  font-size: 14px;
  color: var(--planit-text-dark);
  background: #FFFFFF;
}
.planit-input:focus,
.planit-select:focus,
.planit-textarea:focus {
  outline: none;
  border-color: var(--planit-brand);
  box-shadow: 0 0 0 3px rgba(78, 4, 55, 0.12);
}

/* Registration pages keep Bootstrap's grid/form-control/form-select (working,
   low-risk) — these two rules just fold them into the same type/focus system
   without touching any markup or the intl-tel-input integration. */
.form-control, .form-select, .form-check-label { font-family: inherit; }
.form-control:focus, .form-select:focus {
  border-color: var(--planit-brand);
  box-shadow: 0 0 0 3px rgba(78, 4, 55, 0.12);
}

.planit-field-row { display: flex; gap: 12px; }
.planit-field-row > .planit-field { flex: 1; margin-bottom: 14px; }

.planit-error-text { color: var(--planit-error); font-size: 13px; margin-top: 8px; min-height: 1em; }

/* ---------- Wishlist item cards (warm, low-friction "reserve a gift") ---------- */

.planit-gift-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--planit-accent);
}
.planit-gift-card--reserved { border-top-color: var(--planit-success); }

.planit-gift-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 127, 80, 0.14);
  font-size: 18px;
  flex-shrink: 0;
}

.planit-reserved-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(76, 175, 80, 0.08);
  border-left: 3px solid var(--planit-success);
  font-size: 13px;
  font-style: italic;
  color: var(--planit-text-dark);
}

.planit-note-form {
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  margin-top: 14px;
  padding-top: 14px;
}

/* ---------- Event detail rows (date/venue/notes cards) ---------- */

.planit-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #faf7f5);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.planit-detail-row:hover {
  border-color: rgba(255, 127, 80, 0.35);
  background: linear-gradient(180deg, #fff, #fef3ee);
}
.planit-detail-row + .planit-detail-row { margin-top: 14px; }
.planit-detail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 127, 80, 0.12);
  font-size: 19px;
  line-height: 1;
  flex-shrink: 0;
}
.planit-detail-label { font-size: 12px; font-weight: 600; color: var(--planit-text-muted); margin-bottom: 4px; }
.planit-detail-main { font-size: 15px; font-weight: 600; color: var(--planit-text-dark); }
.planit-detail-sub { font-size: 13px; color: var(--planit-text-muted); margin-top: 2px; }
.planit-detail-row a { font-size: 13px; font-weight: 600; text-decoration: none; }

/* ---------- Utility ---------- */

.planit-muted { color: var(--planit-text-muted); }
.planit-hidden { display: none !important; }
.planit-mt-8 { margin-top: 8px; }
.planit-mt-16 { margin-top: 16px; }
.planit-mt-24 { margin-top: 24px; }

footer.planit-footer {
  text-align: center;
  padding: 24px 0 32px;
  color: var(--planit-text-muted);
  font-size: 13px;
}

/* ---------- Cookie consent banner ---------- */

.planit-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 999;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: planit-cookie-in 0.3s ease;
}
.planit-cookie-banner a { color: var(--planit-brand); font-weight: 600; }

@keyframes planit-cookie-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .planit-cookie-banner .planit-btn-row { flex-direction: column; }
  .planit-cookie-banner .planit-btn { width: 100%; }
}

/* ---------- Photo upload: thumbnail grid + lightbox ---------- */

.planit-photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.planit-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #F0ECE9;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}
.planit-photo-thumb:hover { transform: scale(1.03); }
.planit-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.planit-photo-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.planit-photo-thumb-remove:hover { background: rgba(0, 0, 0, 0.75); }

.planit-photo-thumb-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 4, 14, 0.4);
  color: #fff;
  font-size: 20px;
}

.planit-photo-notice { margin-top: 10px; }

.planit-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 4, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  z-index: 1000;
}
.planit-lightbox img {
  max-width: 88vw;
  max-height: 68vh;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.planit-lightbox-controls { display: flex; align-items: center; gap: 20px; }
.planit-lightbox-btn,
.planit-lightbox-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.planit-lightbox-btn:hover,
.planit-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.planit-lightbox-close { position: absolute; top: 20px; right: 20px; }
.planit-lightbox-counter { color: rgba(255, 255, 255, 0.8); font-size: 13px; min-width: 60px; text-align: center; }
