:root {
  --azul-noche: #07131D;
  --dorado: #F7AA42;
  --naranja: #CB6908;
  --coral: #FC785D;
  --topo: #B9A89C;
  --crema: #F8D9B5;
  --gris-calido: #665A57;
  --blanco: #FFFFFF;

  --font-heading: "Baloo 2", sans-serif;
  --font-body: "Nunito", sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 24px 60px -20px rgba(7, 19, 29, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--azul-noche);
  background: linear-gradient(180deg, #FFF6EC 0%, var(--crema) 100%);
  position: relative;
}

/* Decorative background blobs, matching brand banner */
.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
  filter: blur(2px);
}
.shape-1 {
  width: 340px; height: 340px;
  background: var(--coral);
  top: -140px; left: -120px;
  opacity: 0.25;
}
.shape-2 {
  width: 260px; height: 260px;
  background: var(--dorado);
  bottom: -100px; right: -90px;
  opacity: 0.25;
}
.shape-3 {
  width: 180px; height: 180px;
  background: var(--topo);
  bottom: 20%; left: -100px;
  opacity: 0.2;
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 14px;
}

.topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 10px;
}
.logo {
  height: 40px;
  width: auto;
}

/* Language switcher — which language to receive the newsletter emails in.
   Pinned to the true top-right corner of the viewport, outside the card. */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.lang-flag {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  background: var(--blanco);
  border: 2px solid var(--crema);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(7, 19, 29, 0.2);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.lang-flag:hover {
  border-color: var(--dorado);
}
.lang-flag.selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(252, 120, 93, 0.25);
  transform: scale(1.08);
}

@media (max-width: 480px) {
  .lang-switcher { top: 10px; right: 10px; gap: 3px; }
  .lang-flag { width: 24px; height: 24px; font-size: 13px; }
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--blanco);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.foot {
  flex-shrink: 0;
  margin-top: 10px;
  color: var(--gris-calido);
  font-size: 13px;
  text-align: center;
}
.foot .heart {
  color: var(--coral);
}

/* Progress bar */
.progress[hidden] {
  display: none;
}
.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 16px;
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--crema);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--dorado), var(--coral));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.progress-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gris-calido);
  white-space: nowrap;
}

/* Screen container */
#screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.35s ease;
  overflow-y: auto;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-weight: 800;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  margin: 0 0 6px;
  flex-shrink: 0;
}

h1, h2 {
  font-family: var(--font-heading);
  color: var(--azul-noche);
  margin: 0 0 8px;
  line-height: 1.15;
  flex-shrink: 0;
}
h1 { font-size: 26px; }
h2 { font-size: 20px; }

.subtitle {
  color: var(--gris-calido);
  font-size: 14.5px;
  line-height: 1.45;
  margin: 0 0 16px;
  flex-shrink: 0;
}

.hero-emoji {
  font-size: 44px;
  margin-bottom: 6px;
  line-height: 1;
}

.spacer { flex: 1; }

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 999px;
  padding: 15px 26px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--coral);
  color: var(--blanco);
  box-shadow: 0 10px 24px -8px rgba(252, 120, 93, 0.6);
  width: 100%;
}
.btn-primary:hover { background: var(--naranja); }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--gris-calido);
  padding: 12px 10px;
}
.btn-ghost:hover { color: var(--azul-noche); }

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-shrink: 0;
}
.actions .btn-primary { flex: 1; }

/* Options — single/multi choice */
.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Inline field revealed by an "other" option (free-text follow-up) */
.other-field {
  margin-top: 8px;
  flex-shrink: 0;
  animation: fadeIn 0.25s ease;
}

/* Custom dropdown (no native <select>) revealed by an "other" option */
.dropdown-field {
  position: relative;
  margin-top: 8px;
  flex-shrink: 0;
  animation: fadeIn 0.25s ease;
}
.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  padding: 11px 16px;
  border: 2px solid var(--coral);
  border-radius: var(--radius-md);
  background: #FFF3EF;
  color: var(--azul-noche);
  outline: none;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease;
}
.dropdown-trigger-label.placeholder {
  color: var(--topo);
  font-weight: 600;
}
.dropdown-caret {
  flex-shrink: 0;
  color: var(--gris-calido);
  transition: transform 0.2s ease;
}
.dropdown-field.open .dropdown-caret {
  transform: rotate(180deg);
}

/* position:fixed + top/left/width set via JS (script.js), so the panel
   escapes .card/#screen's clipping and is always fully visible on screen. */
.dropdown-panel {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 232px;
  overflow-y: auto;
  padding: 6px;
  background: var(--blanco);
  border: 2px solid var(--crema);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transform-origin: top center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.dropdown-field.open .dropdown-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dropdown-field.drop-up .dropdown-panel {
  transform-origin: bottom center;
  transform: translateY(8px) scale(0.98);
}
.dropdown-field.drop-up.open .dropdown-panel {
  transform: translateY(0) scale(1);
}

.dropdown-option {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--azul-noche);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.dropdown-option:hover {
  background: var(--crema);
}
.dropdown-option.selected {
  background: #FFF3EF;
  color: var(--naranja);
}
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 2px solid var(--crema);
  border-radius: var(--radius-md);
  background: var(--blanco);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--azul-noche);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}
.option:hover { border-color: var(--dorado); }
.option.selected {
  border-color: var(--coral);
  background: #FFF3EF;
}
.option .emoji {
  font-size: 22px;
}
.option .check {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--topo);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option.selected .check {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--blanco);
  font-size: 13px;
}

/* Text input */
.field {
  width: 100%;
}
.field.field-stacked {
  margin-bottom: 10px;
}
input[type="text"],
input[type="email"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 16px;
  border: 2px solid var(--crema);
  border-radius: var(--radius-md);
  outline: none;
  color: var(--azul-noche);
  transition: border-color 0.15s ease;
}
input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--coral);
}
input::placeholder { color: var(--topo); }

.error-msg {
  color: var(--coral);
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 18px;
}

.privacy-note {
  font-size: 12.5px;
  color: var(--topo);
  margin-top: 14px;
  line-height: 1.5;
  text-align: center;
}

/* Consent checkbox — data protection opt-in */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
}
input[type="checkbox"].consent-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 2px solid var(--topo);
  border-radius: 6px;
  background: var(--blanco);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input[type="checkbox"].consent-checkbox:hover {
  border-color: var(--dorado);
}
input[type="checkbox"].consent-checkbox:checked {
  background: var(--coral);
  border-color: var(--coral);
}
input[type="checkbox"].consent-checkbox:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blanco);
  font-size: 13px;
  font-weight: 700;
}
.consent-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--gris-calido);
  font-weight: 600;
}
.consent-link {
  color: var(--coral);
  font-weight: 700;
  text-decoration: underline;
}
.consent-link:hover {
  color: var(--naranja);
}
.consent-hint {
  font-size: 12.5px;
  color: var(--topo);
  margin: 6px 0 0 30px;
  min-height: 16px;
  line-height: 1.4;
}

/* Intro & outro screens */
.center-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  flex: 1;
}
.center-screen h1 { font-size: 26px; }
.center-screen .subtitle { max-width: 340px; }

@media (max-width: 400px) {
  .card { padding: 18px 18px 16px; }
  h1 { font-size: 23px; }
}
