/* ═══════════════════════════════════════════════════
   REVOLUX — CAPTAÇÃO (Lead Capture SPA)
   Estilos específicos das telas de Login e Formulário
   Depende de: tokens.css, base.css, animations.css, components.css
═══════════════════════════════════════════════════ */

/* Esta página roda fora do fluxo do site institucional (sem core.js
   controlando o cursor customizado), então reativamos o cursor nativo. */
body {
  cursor: auto;
  min-height: 100vh;
}
button, a, select, input, textarea, .btn-primary, .btn-ghost, .btn-text {
  cursor: pointer;
}

/* ── Wrapper geral ── */
.rl-app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--section-px-sm);
  position: relative;
}
.rl-app::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(199,155,116,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(199,155,116,0.06) 0%, transparent 55%);
  pointer-events: none;
}

/* ── Telas (Login / Formulário) ── */
.rl-screen {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}
.rl-screen[hidden] { display: none; }

/* Transição de fade entre telas */
.rl-screen.rl-fade-out {
  animation: rlFadeOut 0.4s var(--ease-smooth) forwards;
}
.rl-screen.rl-fade-in {
  animation: rlFadeIn 0.55s var(--ease-out) both;
}
@keyframes rlFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}
@keyframes rlFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cartão base (login / formulário) ── */
.rl-login-card,
.rl-form-card {
  background: var(--verde-deep);
  border: var(--border-gold);
  border-radius: 4px;
  padding: 48px 40px;
  box-shadow: var(--shadow-card);
}
@media (max-width: 560px) {
  .rl-login-card, .rl-form-card { padding: 36px 24px; }
}

.rl-login-card { text-align: center; }
.rl-login-card h1 {
  font-size: clamp(26px, 4vw, 32px);
  color: var(--bege);
  margin-bottom: 12px;
}
.rl-login-sub {
  font-size: 13px;
  color: var(--bege-dim);
  line-height: 1.6;
  margin-bottom: 32px;
}
.rl-login-card .lead-form { text-align: left; margin-bottom: 4px; }
.rl-login-btn { width: 100%; justify-content: center; margin-top: 6px; }

/* ── Cabeçalho da tela de formulário ── */
.rl-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}
.rl-form-header h1 {
  font-size: clamp(24px, 4vw, 30px);
  color: var(--bege);
}
.rl-form-header .btn-text { font-size: 10px; white-space: nowrap; margin-top: 4px; }

.rl-submit-btn { width: 100%; justify-content: center; margin-top: 4px; }
.rl-new-lead-btn { width: 100%; justify-content: center; margin-top: 18px; }

/* ═══════════════════════════════════════
   ESTADOS DE VALIDAÇÃO (padrão .lf-invalid / .lf-valid)
═══════════════════════════════════════ */
.form-group.lf-invalid input,
.form-group.lf-invalid select,
.form-group.lf-invalid textarea {
  border-color: #ef4444 !important;
  background-color: rgba(239,68,68,0.05) !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.form-group.lf-invalid > label {
  color: #f87171 !important;
  animation: lf-labelPulse 0.6s ease 1;
}
@keyframes lf-labelPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.lf-field-error-msg {
  display: block;
  font-size: 11.5px;
  color: #f87171;
  margin-top: -2px;
  letter-spacing: 0.02em;
  animation: rlFadeIn 0.25s ease forwards;
}
.form-group.lf-valid input,
.form-group.lf-valid select,
.form-group.lf-valid textarea {
  border-color: rgba(199,155,116,0.35) !important;
  box-shadow: none !important;
  background-color: rgba(249,236,204,0.04) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-group.lf-valid > label { color: var(--bege) !important; }

/* Campos desabilitados durante o envio */
.form-group.lf-field-loading input,
.form-group.lf-field-loading select,
.form-group.lf-field-loading textarea {
  opacity: 0.55;
  pointer-events: none;
}

/* ── Botão: shake de erro ── */
.lf-btn-shake { animation: lf-shake 0.4s ease; }
@keyframes lf-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ── Botão: spinner de loading ── */
.lf-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(19,48,44,0.3);
  border-top-color: var(--verde-dark);
  border-radius: 50%;
  animation: lf-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}
@keyframes lf-spin { to { transform: rotate(360deg); } }
.btn-primary.lf-btn-loading {
  pointer-events: none;
  opacity: 0.85;
}
.btn-primary.lf-btn-loading .lf-spinner { display: inline-block; }

/* ── Botão: check de sucesso ── */
.lf-check-icon {
  display: none;
  font-size: 14px;
  margin-right: 8px;
  vertical-align: middle;
}
.btn-primary.lf-btn-sent {
  pointer-events: none;
  opacity: 1;
}
.btn-primary.lf-btn-sent .lf-check-icon { display: inline-block; }

/* ═══════════════════════════════════════
   MODAL DE FEEDBACK (POP-UP)
═══════════════════════════════════════ */
.rl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,36,33,0.85); /* Fundo escuro transparente */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rl-modal-overlay:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

.rl-modal {
  background: var(--verde-deep);
  border: var(--border-gold);
  border-radius: 8px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s var(--ease-out);
}

.rl-modal-overlay:not([hidden]) .rl-modal {
  transform: translateY(0) scale(1);
}

.rl-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* Estado de Sucesso */
.rl-modal.success .rl-modal-icon {
  background: var(--amadeirado);
  color: var(--verde-dark);
  box-shadow: 0 0 0 8px rgba(199,155,116,0.15);
}

/* Estado de Erro */
.rl-modal.error .rl-modal-icon {
  background: rgba(244,67,54,0.15);
  color: #f87171;
  border: 1px solid rgba(244,67,54,0.3);
}
.rl-modal.error .rl-modal-title { color: #f87171; }

.rl-modal-title {
  font-size: 26px;
  color: var(--bege);
  margin-bottom: 12px;
}

.rl-modal-sub {
  font-size: 14px;
  color: rgba(249,236,204,0.6);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════
   AJUSTES PARA MOBILE (Smartphones)
═══════════════════════════════════════ */
@media (max-width: 560px) {
  /* 1. Mantém a centralização, mas adiciona padding seguro para rolagem */
  .rl-app {
    align-items: center; /* Volta a centralizar no meio da tela */
    padding: 40px 16px;  /* Dá respiro em cima e embaixo */
  }

  /* 2. O margin: auto evita que o topo seja cortado se a tela for muito pequena */
  .rl-screen {
    margin: auto;
    height: auto;
  }

  /* 3. Reduz o respiro interno dos cartões para dar mais espaço aos campos */
  .rl-login-card, 
  .rl-form-card {
    padding: 32px 20px;
  }

  /* 4. Coloca o botão "Trocar profissional" abaixo do título, sem espremer */
  .rl-form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 24px;
  }
  .rl-form-header .btn-text {
    margin-top: 0;
  }

  /* 5. Ajusta o espaçamento vertical entre os campos para não emendarem */
  .lead-form {
    gap: 16px;
  }

  /* 6. Aumenta a fonte para 16px (EVITA O ZOOM AUTOMÁTICO DO IPHONE) */
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important; 
    padding: 12px 14px;
  }

  /* 7. Ajusta o tamanho do Pop-up (Modal) para Mobile */
  .rl-modal {
    padding: 32px 20px;
  }
  .rl-modal-title {
    font-size: 24px;
  }
}