
:root {
  color-scheme: light;
  --ink: #2f2b2a;
  --muted: #766f6b;
  --paper: #FAF7E6;
  --rose: #c98f99;
  --green: #7f9278;
  --gold: #b69162;
  --line: rgba(92, 72, 58, 0.16);
  --soft: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 68px rgba(83, 62, 48, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: #f4eee7;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(100%, 470px);
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  align-items: stretch;
  padding: 0;
}

.invite-card {
  min-height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0) 0 42%, var(--paper) 42%),
    radial-gradient(circle at 9% 96%, rgba(201, 143, 153, 0.42), transparent 18%),
    radial-gradient(circle at 90% 95%, rgba(127, 146, 120, 0.32), transparent 19%),
    var(--paper);
  box-shadow: var(--shadow);
}

.hero-photo {
  position: relative;
  min-height: 42svh;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.02), rgba(47, 43, 42, 0.15)),
    linear-gradient(145deg, #d7b7a0 0%, #f2d8d3 44%, #b9c7aa 100%);
  background-position: center;
  background-size: cover;
}

.hero-photo::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -1px;
  height: 68px;
  background: var(--paper);
  clip-path: polygon(0 55%, 10% 48%, 21% 58%, 32% 42%, 45% 54%, 56% 36%, 70% 51%, 82% 40%, 93% 53%, 100% 48%, 100% 100%, 0 100%);
}

.loading-pill {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.88);
  color: var(--muted);
  font-size: 0.77rem;
  white-space: nowrap;
}

.loading-pill.is-hidden {
  display: none;
}

.event-panel {
  position: relative;
  z-index: 1;
  margin-top: -18px;
  padding: 0 24px 24px;
  text-align: center;
}

.event-panel::before,
.event-panel::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 104px;
  height: 104px;
  opacity: 0.38;
  pointer-events: none;
  background:
    radial-gradient(circle at 32% 36%, rgba(201, 143, 153, 0.8) 0 9px, transparent 10px),
    radial-gradient(circle at 55% 48%, rgba(226, 176, 151, 0.76) 0 7px, transparent 8px),
    radial-gradient(circle at 42% 64%, rgba(127, 146, 120, 0.72) 0 5px, transparent 6px);
}

.event-panel::before {
  left: -22px;
}

.event-panel::after {
  right: -22px;
  transform: scaleX(-1);
}

.sender {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 11vw, 3.7rem);
  letter-spacing: 0.08em;
  line-height: 1.02;
  font-family: "Pinyon Script", cursive;
    font-weight: 400;
    font-style: normal;
}

.tagline {
  width: min(100%, 292px);
  margin: 13px auto 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  line-height: 1.45;
}

.event-details {
  width: min(100%, 330px);
  margin: 18px auto 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.25;
}

.event-details strong {
  color: var(--ink);
  font-size: 1.04rem;
  letter-spacing: 0.12em;
    font-family: "Roboto Slab", serif;
      font-optical-sizing: auto;
      font-weight: 800;
      font-style: normal;
}

.actions {
  width: min(100%, 340px);
  margin: 21px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border: solid 1px;
  border-radius: 10px;
  border-color: #DAD7CD;
  padding: 15px;
}

.action-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 70px;
  border-radius: 8px;
}

.action-button:hover,
.action-button:focus-visible {
  background: rgba(182, 145, 98, 0.12);
  color: var(--ink);
  outline: none;
}

.icon {
  width: 45px;
  height: 45px;
  display: inline-grid;
  border: 1px solid rgba(182, 145, 98, 0.34);
  border-radius: 999px;
  padding: 6px;
  color: var(--rose);
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #587042;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-button span:last-child {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

.rsvp-panel {
  width: min(100%, 340px);
  margin: 22px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 244, 0.72)),
    radial-gradient(circle at 12% 0%, rgba(201, 143, 153, 0.18), transparent 34%);
  box-shadow: 0 14px 34px rgba(83, 62, 48, 0.1);
  text-align: left;
  display: none;
}

.companion-accepted {
  width: min(100%, 360px);
  margin: 22px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 244, 0.72)),
    radial-gradient(circle at 12% 0%, rgba(201, 143, 153, 0.18), transparent 34%);
  box-shadow: 0 14px 34px rgba(83, 62, 48, 0.1);
  text-align: left;
  display: none;
  width: min(100%, 340px);
}

/* Remove estilos padrões do botão no cabeçalho */
.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.accordion-trigger h2 {
  margin: 0;
  font-size: 1.1rem;
  /* Ajuste se necessário para seu layout */
}

/* Estilo do ícone de seta */
.accordion-icon {
  width: 25px;
  height: 25px;
  transition: transform 0.3s ease;
  border: solid 1px;
  border-radius: 50%
}

/* O conteúdo começa escondido usando truque de grid para transição suave */
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  overflow: hidden;
  height: 0;
}

/* Dentro do grid, precisamos que o filho direto tenha min-height para o truque funcionar */
.accordion-content>div {
  min-height: 0;
}

/* --- ESTADOS ATIVOS (QUANDO ABERTO) --- */

/* Gira a seta para cima */
.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
  background: #A9B494;
}

/* Expande a altura do conteúdo suavemente */
.accordion-trigger[aria-expanded="true"]+.accordion-content {
  grid-template-rows: 1fr;
  margin-top: 14px;
  /* Espaçamento quando aberto */
}

.panel-header span {
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.panel-header h2 {
  margin: 5px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.primary-cta {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.secondary-cta {
  width: 100%;
  min-height: 38px;
  margin-top: 11px;
  border: 1px solid rgba(127, 146, 120, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.add-cta {
  width: min(100%, 340px);;
  min-height: 42px;
  margin-top: 20px;
  border: 1px solid rgba(127, 146, 120, 0.55);
  border-radius: 8px;
  background: #587042;
  color: #ffff;
  cursor: pointer;
  font-weight: 800;
}

.secondary-cta:hover,
.secondary-cta:focus-visible {
  background: rgba(127, 146, 120, 0.12);
  outline: none;
}

.secondary-cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.companions-card {
  margin-top: 15px;
  text-align: center;
}

.companions-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 0 2px 10px;
  font-size: 0.86rem;
}

#countBadge {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.companions-list {
  display: grid;
  gap: 9px;
}

.companions-form {
  margin: 0;
}

.companion-name-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.companion-name-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(182, 145, 98, 0.34);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  outline: none;
}

.companion-name-input:focus {
  border-color: rgba(127, 146, 120, 0.82);
  box-shadow: 0 0 0 3px rgba(127, 146, 120, 0.16);
}

.companion-list-accepted {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(11, 240, 152, 0.22);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 13px;
  background: rgb(70 153 60 / 19%);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 18px rgba(10, 224, 75, 0.06);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}


.companion-option {
  appearance: none;
  width: 100%;
  border: 1px solid rgb(230, 142, 10);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 13px;
  background: rgba(223, 159, 63, 0.233);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.companion-option:hover,
.companion-option:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(201, 143, 153, 0.48);
  outline: none;
}

.companion-option.is-selected {
  background: linear-gradient(135deg, rgba(127, 146, 120, 0.24), rgba(201, 143, 153, 0.18));
  border-color: rgba(127, 146, 120, 0.7);
  box-shadow: 0 12px 26px rgba(127, 146, 120, 0.22);
  transform: translateY(-1px);
}


.companion-option strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.companion-option span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.selection-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(118, 111, 107, 0.28);
  border-radius: 999px;
  color: transparent;
  background: rgba(255, 255, 255, 0.65);
  font-weight: 900;
  display: none;
}

.companion-option.is-selected .selection-mark {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  display: grid;
}

.empty-state {
  margin: 0;
  padding: 14px 12px;
  border: 1px dashed rgba(182, 145, 98, 0.34);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.primary-cta {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--green), #66795e);
  box-shadow: 0 10px 20px rgba(127, 146, 120, 0.22);
}

.primary-cta:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  background: #a7a7a7 !important;
}

.status-text {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.status-text.is-error {
  color: #9a3838;
}

@media (min-width: 471px) {
  .page-shell {
    padding: 24px 12px;
    align-items: center;
  }

  .invite-card {
    min-height: 760px;
    border-radius: 8px;
  }
}

@media (max-width: 390px) {
  .event-panel {
    padding-inline: 18px;
  }

  .hero-photo {
    min-height: 39svh;
  }

  .actions {
    margin-top: 16px;
  }

  .action-button {
    min-height: 62px;
  }

  .icon {
    width: 31px;
    height: 31px;
  }
}

.logo {
  width: 50%;
  /* Ocupa até 90% da largura da tela em celulares */
  max-width: 250px;
  /* Não passa de 250px em telas grandes (evita que fique gigante) */
  margin: 0 auto;
  /* Centraliza a div na horizontal, se necessário */
  padding-top: 20px;
}

/* A Imagem FILHO (respeita a largura da DIV) */
.logo img {
  width: 100%;
  /* Força a imagem a ocupar toda a largura da div .logo */
  height: auto;
  /* Mantém a proporção da imagem sem distorcer ou achatar */
  display: block;
  /* Remove pequenos espaços em branco indesejados abaixo da imagem */
}

/* Fundo escurecido que cobre a tela toda */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #FAF7E6;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;

  /* --- ALTERAÇÕES PARA O EFEITO DE DESLIZE --- */
  transform: translateX(-100%);
  /* Por padrão, ela fica "escondida" totalmente à esquerda */
  pointer-events: none;
  /* Transiciona tanto o transform (movimento) quanto a opacidade suavemente por 0.6 segundos */
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
  opacity: 0;
  max-width: 100%;
}

/* Classe ativada por JS para mostrar o spinner */
.spinner-overlay.active {
  opacity: 1;
  pointer-events: all;
  display: flex;
  flex-direction: column;
  /* --- ALTERAÇÃO PARA O EFEITO DE DESLIZE --- */
  transform: translateX(0);
  /* Quando ativa, ela volta para a posição original na tela */
}

/* O círculo que gira (CORRIGIDO) */
.spinner {
  width: 60px;
  height: 60px;
  border: 10px solid #f3f3f3;
  /* Cor do círculo de fundo */
  border-top: 10px solid #5C7650;
  /* Cor verde da parte que gira */
  border-radius: 50%;

  /* Criamos um nome exclusivo para a animação do círculo: spin-circle */
  animation: spin-circle 1s linear infinite;
}

/* Regra da animação de rotação exclusiva do círculo (CORRIGIDA) */
@keyframes spin-circle {
  0% {
    /* Mudamos de transform para rotate direto, evitando conflito com a div pai */
    rotate: 0deg;
  }

  100% {
    rotate: 360deg;
  }
}


