/* ==========================================================================
   CLUBE DO RH BRASIL - FORMULÁRIO OFICIAL UNITRAN
   Design System: Roxo Unitran, Efeito Espelhado e Fundo MBA
   ========================================================================== */

@font-face {
  font-family: 'Creator Genius';
  src: url('/fonts/CreatorGenius.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Profa';
  src: url('/fonts/Profa-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Profa';
  src: url('/fonts/Profa-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Profa';
  src: url('/fonts/Profa-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Profa';
  src: url('/fonts/Profa-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Identidade Roxo Unitran */
  --color-primary: #7C3AED;
  --color-primary-dark: #5B21B6;
  --color-primary-deep: #2A0747;
  --color-primary-light: #8B5CF6;
  --color-secondary-bright: #C4B5FD;

  /* Fundos & Superfícies */
  --color-asphalt: #0B0F19;
  --color-surface-white: #FFFFFF;
  --color-paper: #F8FAFC;
  --color-line: #CBD5E1;
  --color-line-focus: #7C3AED;
  
  /* Tipografia */
  --color-ink: #111827;
  --color-ink-muted: #4B5563;
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-heading: 'Profa', 'Inter', sans-serif;

  --shadow-card: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-btn: 0 6px 20px rgba(124, 58, 237, 0.35);
  --shadow-btn-hover: 0 10px 28px rgba(124, 58, 237, 0.55);
  --radius-input: 50px; /* Estilo pill do print */
  --radius-card: 32px;  /* Bordas arredondadas do card do print */
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-asphalt);
  color: var(--color-ink);
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden; /* Fundo fixo, sem rolagem na página inteira no desktop */
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Fundo Estilizado com Textura MBA e Luz Ambiente */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(124, 58, 237, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 10% 85%, rgba(91, 33, 182, 0.18) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(11, 15, 25, 0.94) 0%, rgba(15, 23, 42, 0.90) 50%, rgba(11, 15, 25, 0.97) 100%),
    url('/imagens/foto fundo hero section.png');
  background-size: 100% 100%, 100% 100%, 100% 100%, cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Barra Superior de Navegação / Branding no Canto Superior Esquerdo */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  width: auto;
  padding: 16px 24px;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-brand {
  display: flex;
  align-items: center;
}

.logo-unitran-nav {
  height: 32px;
  width: auto;
  object-fit: contain;
  cursor: default;
  user-select: none;
}

/* Estrutura Principal - Centraliza o container na viewport */
.main-wrapper {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  overflow: hidden;
}

.form-outer-container {
  width: 100%;
  max-width: 580px;
  margin: auto;
  display: flex;
  flex-direction: column;
}

/* O Cartão do Formulário - Rolagem vertical interna elegante */
.form-card {
  background: var(--color-surface-white);
  border-radius: 26px;
  padding: 24px 28px 22px;
  box-shadow: var(--shadow-card);
  position: relative;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.4) transparent;
}

/* Scrollbar estilizada e elegante para o container do formulário */
.form-card::-webkit-scrollbar {
  width: 6px;
}

.form-card::-webkit-scrollbar-track {
  background: transparent;
  margin: 16px 0;
}

.form-card::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.35);
  border-radius: 999px;
}

.form-card::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.65);
}

/* Topo do Card - Otimizado sem subtítulo */
.card-header {
  text-align: center;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-logo-wrapper {
  margin-bottom: 8px;
  position: relative;
}

.card-logo {
  height: 85px;
  max-width: 280px;
  width: auto;
  object-fit: contain;
  cursor: default;
  user-select: none;
}

/* Títulos idênticos ao print com destaque */
.card-title-sub {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Formulário e Campos */
.form-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Linhas com 2 Colunas (Nome+CPF e WhatsApp+Cidade) */
.form-row-2col {
  display: flex;
  gap: 12px;
  width: 100%;
}

.form-row-2col > .input-field-group {
  flex: 1;
  min-width: 0;
}

.form-row-2col > .col-grow {
  flex: 1.45;
}

.form-row-2col > .col-fixed-cpf {
  flex: 1;
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.input-field-group label {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
  padding-left: 8px;
  user-select: none;
}

.input-field-group label .required-asterisk {
  color: #EF4444;
  margin-left: 2px;
}

/* Inputs em formato pill idênticos ao print */
.input-control {
  width: 100%;
  height: 38px;
  padding: 0 16px;
  font-family: var(--font-main);
  font-size: 13.5px;
  color: #1F2937;
  background-color: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-input);
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-control::placeholder {
  color: #9CA3AF;
  font-size: 13px;
  font-weight: 400;
}

.input-control:hover {
  border-color: #94A3B8;
}

.input-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
  background-color: #FAFAFA;
}

.input-control.input-error {
  border-color: #EF4444 !important;
  background-color: #FEF2F2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.field-error-msg {
  font-size: 11px;
  color: #EF4444;
  font-weight: 500;
  padding-left: 12px;
  display: none;
}

.field-error-msg.visible {
  display: block;
}

/* ==========================================================================
   BOTÃO DE ENVIO - ROXO UNITRAN + ANIMAÇÃO DE ESPELHO (PLATAFORMA UNITRAN)
   ========================================================================== */
.btn-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-input);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efeito de Espelho Contínuo (Loop elegante) */
.btn-submit::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset-block: -40%;
  left: -46%;
  width: 32%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0;
  transform: translateX(-180%) skewX(-18deg);
  animation: mirrorSweepLoop 4.5s ease-in-out infinite;
}

@keyframes mirrorSweepLoop {
  0%, 25% {
    opacity: 0;
    transform: translateX(-180%) skewX(-18deg);
  }
  40% {
    opacity: 0.75;
  }
  55%, 100% {
    opacity: 0;
    transform: translateX(520%) skewX(-18deg);
  }
}

/* Efeito de Espelho ao Passar o Mouse (Réplica exata da plataforma Unitran) */
.btn-submit::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset-block: -40%;
  left: -46%;
  width: 36%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  opacity: 0;
  transform: translateX(-180%) skewX(-18deg);
  transition: transform 680ms cubic-bezier(0.16, 1, 0.3, 1), opacity 120ms ease-out;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-2px);
}

.btn-submit:hover::after,
.btn-submit:focus-visible::after {
  opacity: 0.95;
  transform: translateX(520%) skewX(-18deg);
}

.btn-submit:active {
  transform: translateY(0);
  background: #4C1D95;
}

.btn-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}

/* Spinner no botão durante envio */
.spinner-btn {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-submit.loading .spinner-btn {
  display: inline-block;
}

.btn-submit.loading .btn-text {
  opacity: 0.85;
}

/* Mensagens de Feedback no Formulário */
.form-feedback-alert {
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  display: none;
  align-items: center;
  gap: 10px;
}

.form-feedback-alert.error {
  display: flex;
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.form-feedback-alert.info {
  display: flex;
  background-color: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

/* Card de Sucesso (Exibido após envio bem-sucedido) */
.success-screen {
  display: none;
  text-align: center;
  padding: 20px 8px;
  animation: fadeIn 0.4s ease forwards;
}

.success-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-icon-badge {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 12px;
}

.success-text {
  font-size: 15.5px;
  color: #4B5563;
  line-height: 1.55;
  max-width: 440px;
  margin-bottom: 28px;
}

.btn-whatsapp-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  padding: 16px 28px;
  background: #25D366;
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-input);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: all 0.25s ease;
  margin-bottom: 14px;
}

.btn-whatsapp-group:hover {
  background: #20BA5A;
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.5);
  transform: translateY(-2px);
}

.btn-reset-form {
  background: none;
  border: none;
  color: #64748B;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
  transition: color 0.2s ease;
}

.btn-reset-form:hover {
  color: #0F172A;
}

/* Copyright dentro do Card */
.card-footer-copy {
  margin-top: 8px;
  font-size: 11px;
  color: #9CA3AF;
  text-align: center;
  user-select: none;
  letter-spacing: -0.01em;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* Separador Visual - Perguntas Opcionais */
.optional-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
}

.optional-section-divider::before,
.optional-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #CBD5E1, transparent);
}

.divider-label {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Select Dropdown estilizado como os inputs */
.select-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8.825a.75.75 0 0 1-.53-.22L1.72 4.855a.75.75 0 1 1 1.06-1.06L6 7.014l3.22-3.22a.75.75 0 1 1 1.06 1.06L6.53 8.605a.75.75 0 0 1-.53.22Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}

.select-control:invalid,
.select-control option[value=""][disabled] {
  color: #9CA3AF;
}

/* Responsividade Mobile */
@media (max-width: 640px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .site-header {
    position: relative;
    padding: 14px 16px 4px;
    width: 100%;
  }

  .header-container {
    justify-content: flex-start;
  }
  
  .logo-unitran-nav {
    height: 28px;
  }

  .main-wrapper {
    padding: 8px 12px 20px;
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .form-outer-container {
    max-height: none;
  }

  .form-card {
    max-height: none;
    overflow-y: visible;
    padding: 18px 16px 16px;
    border-radius: 20px;
  }

  .card-logo {
    height: 42px;
  }

  .card-title-sub {
    font-size: 14px;
  }

  .card-title-main {
    font-size: 17px;
  }

  .input-control {
    height: 38px;
    padding: 0 14px;
    font-size: 13.5px;
  }

  .btn-submit {
    height: 44px;
    font-size: 14.5px;
  }

  .form-row-2col {
    flex-direction: column;
    gap: 8px;
  }

  .select-control {
    padding-right: 32px;
  }
}
