/* Importing Google Fonts - Manrope */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Manrope", sans-serif;
}

:root {
  --bg: #f3f1fb;
  --card: #ffffff;
  --text: #17142b;
  --muted: #6c6887;
  --border: #e4e0f3;
  --brand: #6d4aff;
  --danger: #e5484d;
  --teal: #0fb5a3;
  --radius: 24px;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(109, 74, 255, 0.12), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(15, 181, 163, 0.12), transparent 40%),
    var(--bg);
  color: var(--text);
}

.stage {
  display: grid;
  align-content: center;
  min-height: 100vh;
  max-width: 1080px;
  margin: 0 auto;
  padding: 90px 20px;
}

/* ---------- Intro ---------- */
.intro {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.intro h1 {
  margin: 14px 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.intro h1 span {
  position: relative;
  color: var(--brand);
}

.intro h1 span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 10px;
  border-radius: 6px;
  background: rgba(109, 74, 255, 0.18);
  z-index: -1;
}

.intro p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

kbd {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--card);
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 700;
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 20px 50px -30px rgba(23, 20, 43, 0.25);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.35rem;
}

.card-icon svg,
.modal-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-icon.danger,
.modal-icon.danger {
  background: rgba(229, 72, 77, 0.12);
  color: var(--danger);
}

.card-icon.brand,
.modal-icon.brand {
  background: rgba(109, 74, 255, 0.12);
  color: var(--brand);
}

.card-icon.teal {
  background: rgba(15, 181, 163, 0.12);
  color: var(--teal);
}

.card h2 {
  margin: 18px 0 8px;
  font-size: 1.2rem;
}

.card p {
  flex: 1;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Buttons ---------- */
.trigger,
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s, background 0.2s;
}

.trigger:hover,
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.trigger:focus-visible,
.btn:focus-visible,
.modal-close:focus-visible,
.nav:focus-visible {
  outline: 3px solid rgba(109, 74, 255, 0.45);
  outline-offset: 2px;
}

.danger {
  background: var(--danger);
  box-shadow: 0 10px 24px -10px rgba(229, 72, 77, 0.8);
}

.brand {
  background: var(--brand);
  box-shadow: 0 10px 24px -10px rgba(109, 74, 255, 0.8);
}

.teal {
  background: var(--teal);
  box-shadow: 0 10px 24px -10px rgba(15, 181, 163, 0.8);
}

.card-icon.danger,
.card-icon.brand,
.card-icon.teal,
.modal-icon {
  box-shadow: none;
}

/* The trigger stays in place but invisible while its modal is open */
.trigger.is-hidden {
  visibility: hidden;
}

.btn.ghost {
  background: #f1eff8;
  color: var(--text);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.full {
  width: 100%;
  margin-top: 6px;
}

/* ---------- Modal ---------- */
.modal {
  width: min(460px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 40px 100px -30px rgba(23, 20, 43, 0.5);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(23, 20, 43, 0.45);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}

.modal.is-closing::backdrop {
  animation: fadeOut 0.35s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.modal-body {
  position: relative;
  padding: 32px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1eff8;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.modal-close.light {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 1.5rem;
}

.modal h2 {
  margin: 18px 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.modal p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  font-size: 0.88rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #faf9fe;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.15);
}

.field input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.12);
}

.error {
  min-height: 16px;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

/* Interest chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
  border: 0;
}

.chips legend {
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.chips label {
  cursor: pointer;
}

.chips input {
  position: absolute;
  opacity: 0;
}

.chips span {
  display: inline-block;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.chips input:checked + span {
  border-color: var(--brand);
  background: rgba(109, 74, 255, 0.1);
  color: var(--brand);
}

.chips input:focus-visible + span {
  outline: 3px solid rgba(109, 74, 255, 0.35);
}

/* Loading state */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.is-loading .spinner {
  display: inline-block;
}

.is-loading .label {
  opacity: 0.8;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success screen */
.success {
  padding: 20px 0 6px;
  text-align: center;
}

.success svg {
  width: 84px;
  height: 84px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success circle {
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 0.6s ease forwards;
}

.success path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.4s 0.5s ease forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Lightbox ---------- */
.modal-photo {
  width: min(760px, calc(100% - 32px));
}

.modal-photo .modal-body {
  padding: 0;
}

.photo-art {
  aspect-ratio: 16 / 10;
  transition: opacity 0.25s;
}

.photo-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.photo figcaption {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 20px 26px 24px;
}

.photo h2 {
  margin: 0 0 4px;
}

.photo-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.nav {
  position: absolute;
  top: calc((100% - 92px) / 2);
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.nav.prev {
  left: 16px;
}

.nav.next {
  right: 16px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .modal-body {
    padding: 26px 22px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  .modal::backdrop {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}
