:root {
  --ink: #55383b;
  --muted: #94797a;
  --blush: #fcf3ef;
  --card: #fffdfa;
  --rose: #b85f69;
  --rose-deep: #974c59;
  --line: #edd9d2;
  --gold: #c49a63;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, rgba(237, 184, 173, .42), transparent 21rem),
    radial-gradient(circle at 91% 86%, rgba(234, 196, 183, .55), transparent 24rem),
    linear-gradient(135deg, #f9e8e1, #fff8f4 45%, #f7e6df);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip link ── */
.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 5;
  padding: .7rem 1rem;
  color: white;
  background: var(--rose-deep);
  border-radius: .5rem;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* ── Page shell ── */
.page-shell {
  display: grid;
  min-height: 100vh;
  padding: 3rem 1.25rem;
  place-items: center;
}

/* ── Event card ── */
.event-card {
  position: relative;
  width: min(100%, 760px);
  overflow: hidden;
  padding: clamp(2.8rem, 7vw, 5.5rem) clamp(1.25rem, 7vw, 5.25rem) 2rem;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 2rem;
  background: rgba(255, 253, 250, .86);
  box-shadow: 0 2rem 5rem rgba(103, 61, 57, .16), inset 0 1px rgba(255,255,255,.9);
  text-align: center;
  isolation: isolate;
}

.event-card::before,
.event-card::after {
  position: absolute;
  z-index: -1;
  width: 15rem;
  height: 15rem;
  content: "";
  opacity: .72;
  filter: blur(.2px);
}

.event-card::before {
  top: -5rem;
  left: -5.5rem;
  border: 1px solid #e7c0b4;
  border-radius: 50% 42% 54% 38%;
  box-shadow: 2.4rem 1.8rem 0 -1px #f3d8cf, 4.8rem 3.4rem 0 -1px #e9bfb5;
  transform: rotate(28deg);
}

.event-card::after {
  right: -8rem;
  bottom: -7rem;
  border: 1px solid #dfb3a8;
  border-radius: 42% 56% 40% 52%;
  box-shadow: -2.3rem -2rem 0 -1px #f1d5ca, -4.2rem -3.8rem 0 -1px #e6b9af;
  transform: rotate(-18deg);
}

.card-glow {
  position: absolute;
  z-index: -1;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .47;
}
.card-glow--top { top: -5.8rem; right: 3rem; background: #fae5c8; }
.card-glow--bottom { bottom: -7rem; left: 2rem; background: #f3c8ca; }

.event-header { max-width: 570px; margin: auto; }

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: 0 0 1.25rem;
  color: var(--rose);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.eyebrow span { width: 1.8rem; height: 1px; background: currentColor; opacity: .55; }

h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.55rem, 7vw, 4.7rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.055em;
}
h1 em { color: var(--rose); font-weight: 500; }

.intro {
  max-width: 480px;
  margin: 1.4rem auto 0;
  color: var(--muted);
  font-size: clamp(.94rem, 2vw, 1.05rem);
  line-height: 1.75;
}

/* ── Event meta ── */
.event-meta {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1.8rem;
  margin: 2.75rem 0 2.4rem;
  padding: 1.2rem 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta-item {
  display: flex;
  gap: .72rem;
  align-items: center;
  text-align: left;
}
.meta-item svg {
  width: 1.45rem;
  color: var(--rose);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}
.meta-item span {
  display: block;
  margin-bottom: .18rem;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.meta-item strong {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.4;
}
.meta-divider { width: 1px; background: var(--line); }

/* ── Countdown ── */
.countdown-block > p {
  margin: 0 0 1rem;
  color: var(--gold);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.45rem, 1.8vw, .9rem);
  max-width: 460px;
  margin: auto;
}

.time-unit {
  padding: 1rem .4rem .8rem;
  border: 1px solid rgba(214,171,160,.42);
  border-radius: 1rem;
  background: rgba(255,255,255,.68);
  box-shadow: 0 .5rem 1.5rem rgba(130,75,73,.05);
}
.time-unit strong {
  display: block;
  color: var(--rose-deep);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.55rem, 5vw, 2.35rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.time-unit span {
  display: block;
  margin-top: .5rem;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── Actions ── */
.actions {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-top: 2.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 3rem;
  padding: .8rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button:focus-visible {
  outline: 3px solid rgba(184,95,105,.32);
  outline-offset: 3px;
}
.button--primary {
  color: #fff;
  background: linear-gradient(135deg, #c8737b, var(--rose-deep));
  box-shadow: 0 .65rem 1.25rem rgba(157,75,88,.25);
}
.button--secondary {
  border-color: #dec0b9;
  color: var(--rose-deep);
  background: rgba(255,255,255,.55);
}

.event-card footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: .72rem;
}

/* ── RSVP Modal ── */
.rsvp-modal[hidden] { display: none; }
.rsvp-modal {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  padding: 1rem;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(69, 39, 42, .37);
  backdrop-filter: blur(5px);
  animation: fade-in .2s ease both;
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 2.45rem 2rem 1.85rem;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 1.4rem;
  background: #fffdfb;
  box-shadow: 0 1.6rem 4rem rgba(67, 37, 40, .29);
  text-align: center;
  animation: modal-in .25s cubic-bezier(.2,.9,.25,1.1) both;
}

.modal-card::before {
  position: absolute;
  top: -4rem;
  right: -3rem;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: #f8deda;
  content: "";
  filter: blur(1px);
  opacity: .75;
}

.modal-card > * { position: relative; }

.modal-close {
  position: absolute;
  top: .8rem;
  right: .85rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #fbf1ed;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  place-items: center;
}
.modal-close:hover { color: var(--rose-deep); background: #f6e2dc; }

.modal-kicker {
  margin: 0 0 .5rem;
  color: var(--rose);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.modal-card h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 7vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.modal-card h2 em { color: var(--rose); font-weight: 500; }
.modal-card h2 + p {
  margin: .85rem auto 1.35rem;
  max-width: 300px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.6;
}

.provider-list {
  display: grid;
  gap: .55rem;
}

.provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 2.7rem;
  border: 0;
  border-radius: .55rem;
  color: #fff;
  font: 600 .78rem "DM Sans", sans-serif;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 .3rem .7rem rgba(75, 42, 42, .12);
  transition: transform .15s ease, filter .15s ease;
}
.provider:hover { transform: translateY(-1px); filter: brightness(1.05); }
.provider:active { transform: translateY(0); }

.provider--outlook { background: #0078d4; }
.provider--office { background: #d83b01; }
.provider--yahoo { background: #6001d2; }
.provider--gmail {
  border: 1px solid #e1e4e8;
  color: #495057;
  background: #fff;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 .15rem .4rem rgba(75,42,42,.08);
}
.provider--other { background: #6c757d; }

.provider-logo {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
}

.modal-status {
  margin-top: 1rem;
  min-height: 1.2rem;
  color: var(--muted);
  font-size: .75rem;
}

/* ── Telegram choice / Authenticator code ── */
.telegram-choice {
  display: grid;
  gap: .25rem;
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: #fff8f5;
  text-align: left;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  cursor: pointer;
  user-select: none;
}
.telegram-choice:hover {
  border-color: rgba(184,95,105,.55);
  background: #fff1ec;
}
.telegram-choice.received {
  border-color: rgba(184,95,105,.55);
  background: #fff1ec;
  transform: translateY(-1px);
  cursor: default;
  pointer-events: none;
}
.telegram-choice.loading {
  cursor: default;
  pointer-events: none;
}

.telegram-choice span {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.telegram-choice strong {
  color: var(--rose-deep);
  font-family: "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

.telegram-choice small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
}

/* ── Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #dadce0;
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Demo modal (unused but kept) ── */
.demo-modal[hidden] { display: none; }
.demo-modal {
  position: fixed;
  z-index: 11;
  inset: 0;
  display: grid;
  padding: 1rem;
  place-items: center;
}
.demo-card {
  position: relative;
  width: min(100%, 390px);
  padding: 2.35rem 2rem 1.9rem;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 1.4rem;
  background: #fffdfb;
  box-shadow: 0 1.6rem 4rem rgba(67,37,40,.29);
  text-align: center;
  animation: modal-in .25s cubic-bezier(.2,.9,.25,1.1) both;
}
.demo-brand {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin: 0 auto .85rem;
  border-radius: 1rem;
  color: #fff;
  background: #087ac1;
  font-size: 1.3rem;
  place-items: center;
}
.demo-card h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.25rem;
  line-height: 1.04;
  letter-spacing: -.045em;
}
.demo-card h2 em { color: var(--rose); font-weight: 500; }
.demo-card h2 + p {
  margin: .85rem auto 1.25rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.6;
}
.demo-account {
  display: flex;
  align-items: center;
  width: 100%;
  gap: .75rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  color: var(--ink);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.demo-account:hover { border-color: #cf9da0; background: #fff9f7; }
.demo-account > span:last-child { margin-left: auto; color: var(--rose); font-size: 1.5rem; }
.avatar {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  flex: 0 0 2.3rem;
  border-radius: 50%;
  color: white;
  background: var(--rose);
  font-size: .72rem;
  font-weight: 600;
  place-items: center;
}
.demo-account strong, .demo-account small { display: block; }
.demo-account strong { font-size: .82rem; }
.demo-account small { margin-top: .12rem; color: var(--muted); font-size: .68rem; }
.demo-switch {
  margin-top: 1rem;
  border: 0;
  color: var(--rose-deep);
  background: none;
  font: 600 .75rem "DM Sans", sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Demo page (unused but kept) ── */
.demo-page {
  background: radial-gradient(circle at 15% 10%, rgba(237,184,173,.42), transparent 22rem), linear-gradient(135deg, #f9e8e1, #fff8f4);
}
.demo-page-shell {
  display: grid;
  min-height: 100vh;
  padding: 1rem;
  place-items: center;
}
.demo-page-card { max-width: 410px; }
.demo-page-card h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.25rem;
  line-height: 1.04;
  letter-spacing: -.045em;
}
.demo-page-card h1 em { color: var(--rose); font-weight: 500; }
.demo-page-card h1 + p {
  margin: .85rem auto 1.25rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.6;
}
.back-link {
  display: inline-block;
  margin-bottom: 1.3rem;
  color: var(--rose-deep);
  font-size: .76rem;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ── Utilities ── */
body.modal-open { overflow: hidden; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(1rem) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Responsive ── */
@media (max-width: 610px) {
  .page-shell { padding: 1rem .7rem; }
  .event-card { border-radius: 1.45rem; }
  .event-meta { align-items: flex-start; flex-direction: column; gap: 1rem; padding-left: 1.2rem; }
  .meta-divider { width: 100%; height: 1px; }
  .actions { flex-direction: column; }
  .button { width: 100%; }
  .time-unit { border-radius: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
