:root {
  --primary: #dd3187;
  --mystic-purple: #3f2a56;
  --mystic-blue: #0b3d91;
  --bg-light: #f8f6f7;
  --text-color: #333333;
  --body-font: 'Plus Jakarta Sans', sans-serif;
  --heading-font: 'Playfair Display', serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-light);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(221, 49, 135, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(11, 61, 145, 0.08) 0%, transparent 50%);
  color: var(--text-color);
  font-family: var(--body-font);
  text-align: center;
  padding: 1.5rem;
  -webkit-font-smoothing: antialiased;
}

/* =========================
   LOADING CARD
   ========================= */

.loading-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2.5rem 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(221, 49, 135, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  max-width: 384px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spinner com ícone central */
.spinner-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 2rem;
}

.spinner-glow {
  position: absolute;
  inset: 0;
  background: rgba(221, 49, 135, 0.1);
  border-radius: 50%;
  filter: blur(16px);
}

#spinner {
  width: 80px;
  height: 80px;
  border: 4px solid #f1f5f9;
  border-top-color: var(--primary);
  border-right-color: var(--mystic-blue);
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.spinner-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-icon .material-icons {
  font-size: 24px;
  color: rgba(221, 49, 135, 0.3);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Título */
h1, .loading-card h1 {
  font-family: var(--heading-font);
  font-size: 1.625rem;
  line-height: 1.25;
  color: var(--mystic-purple);
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

h1::after { display: none; }

/* Divisor decorativo */
.title-divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--mystic-blue));
  border-radius: 9999px;
  margin-bottom: 1.5rem;
}

/* Teaser */
#teaser {
  font-size: 0.875rem;
  color: rgba(11, 61, 145, 0.7);
  font-weight: 500;
  letter-spacing: 0.025em;
  margin-bottom: 3rem;
  min-height: 1.4em;
}

/* Barra de progresso */
.progress-section {
  width: 100%;
  margin-top: auto;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: rgba(221, 49, 135, 0.6);
}

.progress-percent {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mystic-purple);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--mystic-blue));
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* =========================
   FORM CARD (Estado 2)
   ========================= */

.form-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(221, 49, 135, 0.1);
  max-width: 420px;
  width: 100%;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease-out;
}

.form-card .form-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin: 0 auto 1.5rem;
}

.form-card .form-icon .material-icons {
  font-size: 30px;
  color: var(--primary);
}

.form-card h1 {
  font-family: var(--heading-font);
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--mystic-purple);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.form-subtitle {
  font-size: 0.875rem;
  color: var(--mystic-blue);
  opacity: 0.7;
  margin-bottom: 2rem;
  font-weight: 500;
}

/* Labels */
.form-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(221, 49, 135, 0.7);
  margin-bottom: 0.5rem;
  margin-left: 0.5rem;
  text-align: left;
}

/* Input de texto */
.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 9999px;
  padding: 1rem 1.5rem;
  font-family: var(--body-font);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-color);
  box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.05);
  outline: none;
  transition: box-shadow 0.2s;
}

.form-input::placeholder {
  color: #94a3b8;
}

.form-input:focus {
  box-shadow: 0 0 0 2px rgba(221, 49, 135, 0.3);
}

/* Grid de selects (dia/mês/ano) */
.form-dob-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 0.75rem;
}

/* Select wrapper para seta customizada */
.form-select-wrap {
  position: relative;
}

.form-select-wrap::after {
  content: '\25BC';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.5rem;
  color: rgba(221, 49, 135, 0.4);
  pointer-events: none;
}

.form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 9999px;
  padding: 1rem 1.5rem 1rem 1.25rem;
  font-family: var(--body-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-color);
  box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.05);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.form-select:focus {
  box-shadow: 0 0 0 2px rgba(221, 49, 135, 0.3);
}

/* Grupo do campo */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

/* Botão submit */
.form-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--mystic-blue));
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 1rem;
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(221, 49, 135, 0.2);
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 0.5rem;
}

.form-btn:hover {
  opacity: 0.9;
}

.form-btn:active {
  transform: scale(0.98);
}

/* Mensagem de erro inline */
.form-error {
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.5rem;
  margin-left: 0.5rem;
  min-height: 1.2em;
  text-align: left;
}

.form-error:empty {
  display: none;
}

/* Microcopy de rodapé */
.form-footer {
  margin-top: 2rem;
  font-size: 0.625rem;
  color: rgba(74, 111, 165, 0.5);
  font-style: italic;
  font-weight: 500;
  max-width: 240px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* =========================
   CONFIRM CARD (Estado 3)
   ========================= */

.confirm-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(221, 49, 135, 0.1);
  max-width: 420px;
  width: 100%;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease-out;
}

.confirm-card h1 {
  font-family: var(--heading-font);
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--mystic-purple);
  font-weight: 700;
  margin-bottom: 2rem;
}

.confirm-data {
  text-align: center;
  margin-bottom: 1rem;
}

.confirm-data-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: rgba(221, 49, 135, 0.5);
  margin-bottom: 0.375rem;
}

.confirm-data-value {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--mystic-purple);
}

.confirm-divider {
  width: 100%;
  height: 1px;
  background: rgba(63, 42, 86, 0.1);
  margin: 1rem 0;
}

.confirm-hint {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--mystic-blue);
  opacity: 0.8;
  margin: 1.5rem 0;
  line-height: 1.5;
}

.confirm-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--mystic-blue));
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 1rem;
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(221, 49, 135, 0.2);
  transition: opacity 0.2s, transform 0.1s;
  margin-bottom: 0.75rem;
}

.confirm-btn-primary:hover { opacity: 0.9; }
.confirm-btn-primary:active { transform: scale(0.98); }

.confirm-btn-secondary {
  width: 100%;
  background: #fff;
  color: var(--mystic-purple);
  border: 2px solid rgba(63, 42, 86, 0.2);
  border-radius: 9999px;
  padding: 1rem;
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.confirm-btn-secondary:hover { opacity: 0.85; }
.confirm-btn-secondary:active { transform: scale(0.98); }

/* =========================
   RESPONSIVIDADE
   ========================= */

@media (max-width: 600px) {
  .loading-card {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 20px;
  }

  h1, .loading-card h1, .form-card h1, .confirm-card h1 {
    font-size: 1.4rem;
  }

  .spinner-container {
    width: 70px;
    height: 70px;
  }

  #spinner {
    width: 70px;
    height: 70px;
  }

  .form-card, .confirm-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
}

@media (max-width: 400px) {
  h1, .loading-card h1, .form-card h1, .confirm-card h1 {
    font-size: 1.25rem;
  }

  .loading-card {
    padding: 1.75rem 1.25rem 1.25rem;
  }

  .form-card, .confirm-card {
    padding: 1.75rem 1.25rem;
  }

  .form-dob-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}
