/* ==========================================================================
   UI: botões, formulários, alertas, menu
   ========================================================================== */

.btn {
  --btn-bg: var(--sea-deep);
  --btn-fg: var(--white);
  --btn-bd: transparent;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.85rem;
  padding: 0.65rem 1.35rem;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  color: var(--btn-fg);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 61, 72, 0.18);
}

.btn:active {
  transform: translateY(0);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--sea-deep);
  --btn-bd: rgba(15, 61, 72, 0.28);
}

.btn--ghost:hover {
  --btn-bg: rgba(15, 61, 72, 0.06);
  box-shadow: none;
}

.btn--soft {
  --btn-bg: var(--foam);
  --btn-fg: var(--sea-deep);
}

.btn--idle,
.btn--idle:hover {
  --btn-bg: rgba(15, 61, 72, 0.12);
  --btn-fg: rgba(15, 61, 72, 0.45);
  --btn-bd: transparent;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--ready {
  --btn-bg: var(--gold-soft);
  --btn-fg: #fffcf8;
  box-shadow: 0 10px 28px rgba(232, 184, 42, 0.32);
}

.btn--ready:hover {
  --btn-bg: var(--gold);
  box-shadow: 0 12px 30px rgba(232, 184, 42, 0.4);
}

.btn--lg {
  min-height: 3.5rem;
  padding: 0.95rem 2.1rem;
  font-size: 1.12rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

.btn--yes,
.btn--no {
  min-width: 5.2rem;
  border-radius: 999px;
  font-weight: 300;
}

.btn--yes {
  --btn-bg: rgba(47, 107, 79, 0.1);
  --btn-fg: var(--ok);
  --btn-bd: rgba(47, 107, 79, 0.35);
}

.btn--no {
  --btn-bg: rgba(155, 59, 59, 0.08);
  --btn-fg: var(--danger);
  --btn-bd: rgba(155, 59, 59, 0.3);
}

/* Radio estilizado como botão Sim/Não */
.choice {
  position: relative;
  display: block;
}

.guest__choices .choice {
  display: block;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice > span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 61, 72, 0.2);
  background: rgba(255, 252, 248, 0.7);
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s var(--ease);
  user-select: none;
  overflow: hidden;
}

.choice--yes input:checked + span {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
  box-shadow: none;
}

.choice--no input:checked + span {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: none;
}

.guest__choices--locked {
  pointer-events: none;
}

.guest__choices--locked .choice > span {
  cursor: default;
  opacity: 0.4;
}

.guest__choices--locked .choice.is-selected > span {
  opacity: 1;
}

.choice--yes.is-selected > span {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
  box-shadow: none;
}

.choice--no.is-selected > span {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: none;
}

.guest__dietary {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md, 10px);
  background: rgba(184, 221, 216, 0.22);
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: left;
}

.guest__dietary-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sea-deep);
}

.choice:focus-within > span {
  outline: 2px solid var(--sea);
  outline-offset: 2px;
}

.choice-mood {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.choice--yes .choice-mood {
  left: 0.35rem;
  right: auto;
}

.choice--no .choice-mood {
  right: 0.35rem;
  left: auto;
}

.choice--yes input:checked + span .choice-mood::before {
  content: "😊";
}

.choice--no input:checked + span .choice-mood::before {
  content: "😢";
}

.choice input:checked + span .choice-mood {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.choice--yes.is-selected > span .choice-mood::before {
  content: "😊";
}

.choice--no.is-selected > span .choice-mood::before {
  content: "😢";
}

.choice.is-selected > span .choice-mood {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label,
.field .label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sea-deep);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="file"],
.field textarea {
  width: 100%;
  border: 1px solid rgba(15, 61, 72, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 248, 0.85);
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
}

.field textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(31, 111, 122, 0.35);
  border-color: var(--sea);
}

.help {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.alert {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
}

.alert--ok {
  background: rgba(47, 107, 79, 0.1);
  border-color: rgba(47, 107, 79, 0.25);
  color: var(--ok);
}

.alert--error {
  background: rgba(155, 59, 59, 0.08);
  border-color: rgba(155, 59, 59, 0.25);
  color: var(--danger);
}

.alert--info {
  background: rgba(31, 111, 122, 0.08);
  border-color: rgba(31, 111, 122, 0.2);
  color: var(--sea-deep);
}

.presenca-save {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.presenca-save [data-presenca-flash]:empty {
  display: none;
}

.presenca-save [data-presenca-save].is-presenca-save-hidden,
.presenca-save [data-presenca-save][hidden] {
  display: none !important;
}

.presenca-note {
  margin: 0;
  max-width: 28rem;
  padding: 1.35rem 1.55rem;
  text-align: center;
  font-family: var(--font-script, "Allura", cursive);
  font-size: clamp(1.35rem, 3.6vw, 1.75rem);
  line-height: 1.25;
  color: #fffcf8;
  text-shadow: 0 1px 2px rgba(58, 40, 20, 0.22);
  background: linear-gradient(45deg, #f8e48a 0%, var(--gold-soft) 42%, var(--gold) 100%);
  border: 1px solid rgba(232, 184, 42, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 24px rgba(232, 184, 42, 0.24);
  animation: rise-in 0.55s var(--ease) both;
}

/* Detalhe expandível (restrição alimentar) só com CSS */
.disclose {
  border-top: 0;
  margin-top: 0.85rem;
  padding-top: 0;
}

.disclose > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--sea);
  font-weight: 600;
  font-size: 0.95rem;
  user-select: none;
}

.disclose > summary::-webkit-details-marker {
  display: none;
}

.disclose > summary::before {
  content: "+";
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(31, 111, 122, 0.35);
  background: rgba(184, 221, 216, 0.35);
  font-size: 1.1rem;
  line-height: 1;
}

.disclose[open] > summary::before {
  content: "–";
}

.disclose .field {
  margin-top: var(--space-3);
}

/* Quem não vai: oculta restrição alimentar (CSS-only) */
.guest:has(.choice--no input:checked) .disclose--dietary {
  display: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 14rem));
  gap: var(--space-4);
  justify-content: center;
  max-width: 46rem;
  margin-inline: auto;
  width: 100%;
}

.photo-card {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 252, 248, 0.9);
  aspect-ratio: 1;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card__fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  background: var(--mist);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.photo-card__remove {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  margin: 0;
}

.photo-card__remove button {
  appearance: none;
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 52, 63, 0.55);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.2s var(--ease);
}

.photo-card__remove button:hover {
  background: rgba(155, 59, 59, 0.85);
}

.photo-add {
  margin: 0;
  aspect-ratio: 1;
}

.photo-add__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: 100%;
  border: 1.5px dashed rgba(31, 111, 122, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(184, 221, 216, 0.18);
  color: var(--sea-deep);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.photo-add__btn:hover {
  background: rgba(184, 221, 216, 0.35);
  border-color: var(--sea);
  transform: translateY(-1px);
}

.photo-add__plus {
  display: grid;
  place-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: var(--sea-deep);
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 400;
}

.photo-add.is-uploading .photo-add__btn {
  opacity: 0.55;
  pointer-events: none;
}
