:root {
  color-scheme: light;
  --bg-start: #fff6ee;
  --bg-end: #f6f1ff;
  --card: rgba(255, 255, 255, 0.74);
  --card-border: rgba(255, 255, 255, 0.45);
  --text: #20161f;
  --muted: #6c5d68;
  --accent: #e95f7b;
  --accent-deep: #c93f63;
  --accent-2: #ffb469;
  --shadow: 0 20px 60px rgba(97, 52, 72, 0.16);
  --yes-gradient: linear-gradient(135deg, #ff7b8f, #e83f69);
  --no-gradient: linear-gradient(135deg, #fff1f4, #ffd8e0);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Vazirmatn", system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 210, 224, 0.55), transparent 30%),
    linear-gradient(145deg, var(--bg-start), var(--bg-end));
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 24px 40px;
  isolation: isolate;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.55;
  animation: float 10s ease-in-out infinite;
  pointer-events: none;
}

.ambient-one {
  width: 180px;
  height: 180px;
  background: rgba(255, 161, 178, 0.38);
  top: 6%;
  right: 8%;
}

.ambient-two {
  width: 260px;
  height: 260px;
  background: rgba(253, 192, 126, 0.36);
  bottom: 6%;
  left: 4%;
  animation-delay: -2s;
}

.ambient-three {
  width: 120px;
  height: 120px;
  background: rgba(170, 146, 255, 0.24);
  top: 42%;
  left: 12%;
  animation-delay: -4s;
}

.invite-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: 28px 22px 24px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  text-align: center;
  overflow: hidden;
  animation: cardIn 700ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.invite-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 36%),
    radial-gradient(circle at top right, rgba(255, 183, 197, 0.28), transparent 30%);
  pointer-events: none;
}

.step {
  position: relative;
  z-index: 1;
}

.step[hidden] {
  display: none;
}

.step.is-entering {
  animation: stepEnter 700ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(233, 95, 123, 0.12);
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-alt {
  background: rgba(255, 180, 105, 0.16);
  color: #b34d6e;
}

.eyebrow {
  margin: 18px 0 10px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 14px auto 0;
  max-width: 28ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.hero-icon {
  display: grid;
  place-items: center;
  margin: 0 auto -8px;
  animation: iconFloat 7s ease-in-out infinite;
}

.hero-icon img {
  display: block;
  width: min(220px, 72vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(133, 76, 94, 0.18));
}

.scene {
  position: relative;
  margin-top: 0;
  padding: 0;
}

.cta-row {
  position: relative;
  height: 204px;
  margin: 0 auto;
  width: min(100%, 400px);
}

.btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 180ms ease,
    left 260ms cubic-bezier(0.22, 1, 0.36, 1),
    top 260ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
  box-shadow: 0 12px 24px rgba(78, 40, 54, 0.14);
  will-change: left, top, transform;
}

.btn:focus-visible {
  outline: 3px solid rgba(233, 95, 123, 0.28);
  outline-offset: 4px;
}

.btn-yes {
  background: var(--yes-gradient);
  color: #fff;
  font-weight: 800;
  z-index: 2;
}

.btn-yes:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 26px rgba(233, 95, 123, 0.28);
}

.btn-no {
  background: var(--no-gradient);
  color: var(--accent-deep);
  font-weight: 700;
}

.btn-no:hover {
  box-shadow: 0 14px 26px rgba(102, 65, 78, 0.1);
}

.step-intro .badge {
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.step-intro .eyebrow {
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
  animation-delay: 90ms;
}

.step-intro h1 {
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
  animation-delay: 160ms;
}

.step-intro .subtitle {
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
  animation-delay: 230ms;
}

.step-intro .hero-icon {
  animation-delay: 320ms;
}

.step-intro .scene {
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
  animation-delay: 390ms;
}

.step-choice {
  padding-top: 4px;
}

.step-choice .badge {
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.step-choice h2 {
  margin-top: 14px;
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
  animation-delay: 110ms;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.choice-card {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 14px 12px 16px;
  min-height: 168px;
  border: 1px solid rgba(233, 95, 123, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(78, 40, 54, 0.08);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  animation: choiceCardIn 620ms cubic-bezier(0.2, 1, 0.3, 1) both;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.choice-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  border: 1px solid transparent;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

.choice-grid .choice-card:nth-child(1) {
  animation-delay: 180ms;
}

.choice-grid .choice-card:nth-child(2) {
  animation-delay: 250ms;
}

.choice-grid .choice-card:nth-child(3) {
  animation-delay: 320ms;
}

.choice-grid .choice-card:nth-child(4) {
  animation-delay: 390ms;
}

.choice-card img {
  display: block;
  width: min(110px, 22vw);
  height: min(110px, 22vw);
  object-fit: contain;
  transition: transform 220ms cubic-bezier(0.2, 1, 0.3, 1);
}

.choice-card span {
  font-size: 1rem;
  font-weight: 800;
}

.choice-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 26px rgba(78, 40, 54, 0.13);
}

.choice-card.is-selected {
  border-color: rgba(233, 95, 123, 0.4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 241, 244, 0.92));
  box-shadow: 0 18px 30px rgba(233, 95, 123, 0.15);
  transform: translateY(-3px) scale(1.03);
}

.choice-card.is-selected::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(233, 95, 123, 0.18);
  pointer-events: none;
}

.choice-card.is-selected::before {
  border-color: rgba(233, 95, 123, 0.16);
  opacity: 1;
}

.choice-card.is-selected img {
  transform: scale(1.14);
}

.choice-card.is-selected span {
  transform: translateY(1px);
}

.choice-summary {
  display: grid;
  gap: 6px;
  margin: 18px auto 0;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(233, 95, 123, 0.12);
  color: var(--text);
  box-shadow: 0 12px 24px rgba(78, 40, 54, 0.08);
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
  animation-delay: 430ms;
}

.choice-summary-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
}

.choice-summary strong {
  font-size: 1.02rem;
  line-height: 1.6;
}

.confirm-choice-btn {
  margin: 14px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  padding: 13px 22px;
  border: 0;
  border-radius: 18px;
  background: var(--yes-gradient);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(233, 95, 123, 0.25);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
  animation: itemRise 520ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.confirm-choice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(233, 95, 123, 0.3);
}

.confirm-choice-btn:focus-visible {
  outline: 3px solid rgba(233, 95, 123, 0.28);
  outline-offset: 4px;
}

.confirm-choice-btn[hidden] {
  display: none;
}

.confirm-choice-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: 0 10px 18px rgba(233, 95, 123, 0.16);
}

.subtitle-schedule {
  max-width: 34ch;
}

.schedule-grid {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.calendar-panel,
.time-panel {
  padding: 16px 14px 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(233, 95, 123, 0.12);
  box-shadow: 0 12px 24px rgba(78, 40, 54, 0.08);
}

.panel-icon-wrap {
  display: grid;
  place-items: center;
  margin: -6px auto 10px;
}

.panel-icon {
  display: block;
  width: min(86px, 23vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(133, 76, 94, 0.16));
  animation: iconFloat 7s ease-in-out infinite;
}

.panel-icon-time {
  width: min(90px, 24vw);
  animation-delay: -2s;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head-copy {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: center;
  justify-items: center;
}

.panel-kicker {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.day-cell {
  position: relative;
  border: 1px solid rgba(233, 95, 123, 0.1);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 22px;
  min-height: 96px;
  padding: 14px 12px 12px;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(78, 40, 54, 0.05);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
  animation: dayFadeIn 420ms cubic-bezier(0.2, 1, 0.3, 1) both;
  text-align: right;
}

.day-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(78, 40, 54, 0.09);
}

.day-cell.is-today {
  border-color: rgba(255, 180, 105, 0.42);
}

.day-cell.is-selected {
  border-color: rgba(233, 95, 123, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 244, 0.96));
  box-shadow: 0 14px 24px rgba(233, 95, 123, 0.15);
  transform: translateY(-2px) scale(1.02);
}

.day-cell.is-booked {
  background: linear-gradient(180deg, rgba(244, 244, 246, 0.96), rgba(232, 233, 236, 0.96));
  color: rgba(58, 58, 64, 0.72);
  border-color: rgba(120, 124, 138, 0.16);
  box-shadow: none;
}

.day-cell.is-booked:hover {
  transform: none;
  box-shadow: none;
}

.day-cell.is-booked .day-number,
.day-cell.is-booked .day-date,
.day-cell.is-booked .day-meta {
  color: rgba(88, 91, 101, 0.78);
}

.day-number {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.4;
}

.day-date {
  display: block;
  margin-top: 8px;
  font-size: 1.16rem;
  font-weight: 800;
  line-height: 1;
}

.day-meta {
  display: block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--accent-deep);
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.time-chip {
  border: 1px solid rgba(233, 95, 123, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  border-radius: 16px;
  min-height: 46px;
  padding: 10px 8px;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(78, 40, 54, 0.05);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
  animation: dayFadeIn 420ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.time-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(78, 40, 54, 0.09);
}

.time-chip.is-selected {
  border-color: rgba(233, 95, 123, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 244, 0.96));
  box-shadow: 0 14px 24px rgba(233, 95, 123, 0.15);
  transform: translateY(-2px) scale(1.02);
}

.time-chip:disabled,
.day-cell:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.time-grid.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.schedule-summary {
  display: grid;
  gap: 6px;
  margin: 18px auto 0;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(233, 95, 123, 0.12);
  color: var(--text);
  box-shadow: 0 12px 24px rgba(78, 40, 54, 0.08);
  animation: itemRise 640ms cubic-bezier(0.2, 1, 0.3, 1) both;
  animation-delay: 280ms;
}

.confirm-schedule-btn {
  margin-top: 14px;
  margin-bottom: 6px;
}

.step-final .subtitle {
  max-width: 30ch;
}

.step-final h2 {
  margin-top: 14px;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(255, 245, 248, 0.42);
  backdrop-filter: blur(14px);
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-modal {
  width: min(100%, 430px);
  padding: 24px 20px 20px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(233, 95, 123, 0.14);
  box-shadow: 0 24px 60px rgba(97, 52, 72, 0.18);
  text-align: center;
  animation: modalIn 260ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.confirm-modal h3 {
  margin: 0;
  font-size: 1.35rem;
}

.confirm-modal-text {
  margin: 14px auto 0;
  color: var(--muted);
  line-height: 2;
  font-size: 0.98rem;
}

.confirm-modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.confirm-modal-btn {
  width: 100%;
  margin: 0;
}

.confirm-modal-secondary {
  width: 100%;
  padding: 13px 18px;
  border: 1px solid rgba(233, 95, 123, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  box-shadow: 0 10px 18px rgba(78, 40, 54, 0.06);
}

.confirm-modal-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(78, 40, 54, 0.1);
}

.top-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 25;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(233, 95, 123, 0.14);
  color: var(--accent-deep);
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(97, 52, 72, 0.18);
  animation: toastInOut 3000ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.top-toast[hidden] {
  display: none;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -12px, 0) scale(1.04);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes stepEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes itemRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes choiceCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dayFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  12%,
  82% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 18px 18px 42px;
  }

  .invite-card {
    padding: 24px 18px 20px;
    border-radius: 24px;
  }

  .cta-row {
    height: 192px;
    width: 100%;
  }

  .btn {
    width: 118px;
    height: 50px;
  }

  .hero-icon {
    margin-top: 12px;
  }

  .hero-icon img {
    width: min(180px, 66vw);
  }

  .choice-grid {
    gap: 12px;
  }

  .choice-card {
    min-height: 154px;
    padding: 12px 10px 14px;
  }

  .choice-card img {
    width: min(96px, 24vw);
    height: min(96px, 24vw);
  }

  .calendar-panel,
  .time-panel {
    padding: 14px 12px 12px;
    border-radius: 20px;
  }

  .panel-icon-wrap {
    margin: -4px auto 8px;
  }

  .panel-icon {
    width: min(72px, 24vw);
  }

  .panel-icon-time {
    width: min(78px, 25vw);
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .day-cell {
    min-height: 88px;
    padding: 12px 10px 10px;
    border-radius: 20px;
  }

  .day-number {
    font-size: 0.76rem;
  }

  .day-date {
    font-size: 1.04rem;
    margin-top: 7px;
  }

  .day-meta {
    font-size: 0.76rem;
    margin-top: 8px;
  }

  .time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .time-chip {
    min-height: 42px;
    border-radius: 14px;
  }

  .confirm-schedule-btn {
    margin-bottom: 10px;
  }

  .confirm-modal {
    padding: 22px 16px 16px;
    border-radius: 22px;
  }

  .confirm-modal h3 {
    font-size: 1.2rem;
  }

  .confirm-modal-text {
    font-size: 0.92rem;
    line-height: 1.9;
  }

  .top-toast {
    top: 14px;
    width: min(calc(100% - 32px), 340px);
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
