/* ============== Base estrutural (theme-agnostic) ==============
   As cores e fontes vêm de variáveis. Cada tema (themes/*.css) ou o
   admin.css sobrescreve o :root para mudar o visual. */

:root {
  /* paleta neutra default (caso nenhum tema carregue) */
  --primary:        #475569;
  --primary-dark:   #1e293b;
  --primary-soft:   #e2e8f0;
  --accent:         #ef4444;
  --bg:             #f8fafc;
  --bg-alt:         #ffffff;
  --card-bg:        #ffffff;
  --text:           #0f172a;
  --text-soft:      #64748b;
  --border:         #e2e8f0;
  --shadow-color:   rgba(15, 23, 42, 0.10);
  --shadow-sm:      0 4px 12px var(--shadow-color);
  --shadow:         0 10px 30px var(--shadow-color);
  --shadow-lg:      0 20px 50px var(--shadow-color);
  --radius:         18px;
  --display-font:   'Fredoka', system-ui, sans-serif;
  --body-font:      'Fredoka', system-ui, sans-serif;
  --invite-bg:      var(--bg);
  --invite-pattern: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--body-font);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============== Convite (estrutura) ============== */
.invite-body {
  background: var(--invite-bg);
  background-image: var(--invite-pattern);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.float {
  position: absolute;
  font-size: 32px;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}
@keyframes float {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%     { transform: translateY(-18px) rotate(5deg); }
}

.stage {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.loading-card { padding: 60px 28px; }
.spinner {
  width: 42px; height: 42px;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.screen { animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); position: relative; z-index: 1; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* Detalhes da festa */
.details {
  background: var(--bg-alt);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0 24px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--border);
  gap: 12px;
}
.detail:last-child { border-bottom: none; }
.detail .label {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  white-space: nowrap;
}
.detail .value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-size: 15px;
}

/* RSVP */
.rsvp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rsvp-item {
  background: var(--bg-alt);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.member-name {
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 10px;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  font-weight: 600;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
  transition: all 0.2s;
  text-align: center;
  user-select: none;
}
.choice input { display: none; }
.choice:hover { border-color: var(--primary); }
.choice.yes:has(input:checked) {
  background: #c8e6c9;
  border-color: #4caf50;
  color: #1b5e20;
}
.choice.no:has(input:checked) {
  background: #ffcdd2;
  border-color: #e53935;
  color: #b71c1c;
}

/* Erro */
.error-card { padding: 48px 28px; }
.error-card h1 {
  color: var(--primary-dark);
  margin: 12px 0 4px;
}

/* ============== Botões ============== */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s, opacity 0.2s;
  text-decoration: none;
  text-align: center;
  margin: 6px 4px;
  color: var(--text);
  background: var(--bg-alt);
  border: 2px solid var(--border);
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px var(--shadow-color);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px var(--shadow-color); }
.btn.primary:active { transform: translateY(0); }
.btn.primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 2px solid var(--primary-soft);
}
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger {
  background: #ffebee;
  color: #c62828;
  border: 2px solid #ef9a9a;
}
.btn.danger:hover { background: #ffcdd2; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.whatsapp {
  background: #25d366;
  color: white;
  border-color: transparent;
}
.btn.whatsapp:hover { background: #1da851; }

/* ============== Forms (compartilhado) ============== */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  gap: 4px;
}
.form input, .form textarea, .form select {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.15s;
  width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  border-color: var(--primary);
}
.form .error {
  color: #c62828;
  background: #ffebee;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

/* ============== Flash message ============== */
.flash {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary-dark);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}
.flash.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.flash.error { background: #c62828; }
