/* ============================================
   APPFUT - Estilos da Pagina de Cadastro
   ============================================ */

/* Cards de selecao */
.selection-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.selection-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.selection-card:hover {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 4px 12px rgba(0, 168, 89, 0.1);
}

.selection-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon i {
  width: 24px;
  height: 24px;
}

.card-icon.responsavel {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
}

.card-icon.escola {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #16a34a;
}

.card-icon.pf {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #2563eb;
}

.card-icon.pj {
  background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
  color: #9333ea;
}

.card-icon.treinador {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: #0284c7;
}

.selection-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 4px 0;
}

.selection-card p {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
}

.card-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateX(-8px) translateY(-50%);
  opacity: 0;
  color: var(--primary);
  transition: all 0.2s ease;
}

.card-arrow i {
  width: 20px;
  height: 20px;
}

/* Hidden state */
.hidden {
  display: none !important;
}

/* Form groups */
.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

@media (max-width: 500px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Campo de senha com toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--gray-600);
}

.password-toggle i {
  width: 20px;
  height: 20px;
}

/* Indicador de forca da senha */
.password-strength {
  margin-top: 8px;
}

.password-strength-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-fill.weak {
  width: 33%;
  background: #EF4444;
}

.password-strength-fill.medium {
  width: 66%;
  background: #F59E0B;
}

.password-strength-fill.strong {
  width: 100%;
  background: #22C55E;
}

.password-strength-text {
  font-size: 12px;
  color: var(--gray-500);
}

.password-strength-text.weak { color: #EF4444; }
.password-strength-text.medium { color: #F59E0B; }
.password-strength-text.strong { color: #22C55E; }

/* Requisitos de senha */
.password-requirements {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.password-requirements .requirement {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
  transition: color 0.2s;
}

.password-requirements .requirement i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.password-requirements .requirement.met {
  color: #22C55E;
}

.password-requirements .requirement.met i {
  color: #22C55E;
}

/* Checkbox customizado */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-text {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

.checkbox-text a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-text a:hover {
  text-decoration: underline;
}

.terms-group {
  margin-bottom: 24px;
}

/* Estados de validacao */
.form-input.valid {
  border-color: #22C55E;
}

.form-input.invalid {
  border-color: #EF4444;
}

/* Wrapper para inputs com icone de validacao */
.input-validation-wrapper {
  position: relative;
}

.input-validation-wrapper .form-input {
  padding-right: 40px;
}

/* Mensagem de erro inline */
.field-error {
  display: none;
  font-size: 12px;
  color: #EF4444;
  margin-top: 4px;
}

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

/* Helper text */
.field-helper {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Loading no CNPJ */
.cnpj-loading {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 8px;
}

.cnpj-loading.visible {
  display: flex;
}

.cnpj-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Dados da empresa (quando CNPJ encontrado) */
.company-data {
  display: none;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.company-data.visible {
  display: block;
}

.company-data-item {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.company-data-item:last-child {
  margin-bottom: 0;
}

.company-data-item strong {
  color: var(--gray-800);
}

/* Botao com estados */
.btn .btn-loading-text {
  display: none;
}

.btn.btn-loading .btn-text {
  display: none;
}

.btn.btn-loading .btn-loading-text {
  display: inline;
}

.btn.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  left: calc(50% - 10px);
  top: calc(50% - 10px);
}

/* Modal de sucesso — redesign 2026-06 */
.success-modal {
  text-align: center;
  max-width: 460px;
  padding: 36px 32px 28px;
}

.success-icon {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, #00A859, #00C853);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  box-shadow: 0 10px 30px -8px rgba(0, 168, 89, 0.5);
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-icon i {
  width: 38px;
  height: 38px;
  color: white;
  stroke-width: 3;
}

.success-modal h3 {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.success-modal > p {
  color: var(--gray-600);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 24px;
}

/* Card do código da escola */
.school-code-card {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 18px 20px;
  margin: 0 0 24px;
  text-align: center;
}

.school-code-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #15803d;
  margin-bottom: 6px;
}

.school-code-value-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.school-code-value {
  font-size: 30px;
  font-weight: 800;
  color: #166534;
  font-family: var(--font-display, inherit);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.school-code-copy {
  background: white;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #15803d;
  transition: all 0.15s ease;
}

.school-code-copy:hover {
  background: #f0fdf4;
  border-color: #86efac;
  transform: translateY(-1px);
}

.school-code-copy:active {
  transform: translateY(0);
}

.school-code-copy i {
  width: 16px;
  height: 16px;
}

.school-code-copy.copied {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

.school-code-note {
  font-size: 13px;
  color: #15803d;
  line-height: 1.45;
  margin: 0;
  opacity: 0.85;
}

/* Bloco de benefícios pós-cadastro (substitui o card de código) */
.benefits-card {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 0 0 24px;
  text-align: left;
}

.benefits-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #15803d;
  margin-bottom: 12px;
  text-align: center;
}

.benefits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: #14532d;
  line-height: 1.4;
}

.benefits-list li i {
  width: 18px;
  height: 18px;
  color: #16a34a;
  flex-shrink: 0;
  margin-top: 1px;
}

.benefits-list li span {
  flex: 1;
}

/* Stores section */
.success-stores-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
  text-align: center;
}

.success-stores {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.success-stores .store-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: white;
  color: var(--gray-900);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  transition: all 0.18s ease;
}

.success-stores .store-button:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.15);
}

.success-stores .store-button div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
}

.success-stores .store-button small {
  font-size: 10.5px;
  color: var(--gray-500);
  font-weight: 500;
}

.success-stores .store-button strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.success-back-btn {
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.success-back-btn:hover {
  color: var(--gray-700);
}

@media (max-width: 480px) {
  .success-modal { padding: 28px 20px 22px; }
  .success-stores { flex-direction: column; }
  .success-stores .store-button { width: 100%; }
}

/* Modal de documentos legais */
.legal-modal {
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.legal-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  max-height: 60vh;
}

.legal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--gray-500);
}

.legal-loading .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.legal-content-body {
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
}

.legal-content-body h1 {
  font-size: 22px;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.legal-content-body h2 {
  font-size: 18px;
  color: var(--gray-900);
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.legal-content-body h3 {
  font-size: 16px;
  color: var(--gray-800);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-content-body p {
  margin-bottom: 12px;
}

.legal-content-body ul, .legal-content-body ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.legal-content-body li {
  margin-bottom: 6px;
}

.legal-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.legal-content-body th, .legal-content-body td {
  border: 1px solid var(--gray-200);
  padding: 10px 12px;
  text-align: left;
}

.legal-content-body th {
  background: var(--gray-50);
  font-weight: 600;
}

.legal-content-body blockquote {
  background: #f0fdf4;
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
}

.legal-content-body strong {
  color: var(--gray-900);
}

.legal-content-body a {
  color: var(--primary);
}

.legal-content-body hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 24px 0;
}

/* ============================================
   COMPACT MODE — reduz espaçamento na pagina
   de cadastro pra evitar scroll desnecessario.
   Escopo: tudo dentro de .cadastro-card.
   ============================================ */

/* Card mais largo no desktop pra acomodar 2 colunas */
.cadastro-card { max-width: 560px; }

/* Container do card menor padding */
.cadastro-card.login-card { width: 100%; }

/* Titulos menores */
.cadastro-card h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.cadastro-card .subtitle {
  margin-bottom: 16px;
  font-size: 13px;
}

/* Form groups mais juntos */
.cadastro-card .form-group {
  margin-bottom: 10px;
}

/* Labels menores, sem caps lock vibe — peso normal */
.cadastro-card .form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
  letter-spacing: 0;
  text-transform: none;
}

/* Inputs modernos: fill suave, borda fina, focus com glow verde */
.cadastro-card .form-input,
.cadastro-card .form-select,
.cadastro-card .form-textarea {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  background: #F9FAFB;
  color: var(--gray-900);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.cadastro-card .form-input::placeholder {
  color: #9CA3AF;
  font-weight: 400;
}
.cadastro-card .form-input:hover,
.cadastro-card .form-select:hover {
  border-color: #D1D5DB;
  background: #FFFFFF;
}
.cadastro-card .form-input:focus,
.cadastro-card .form-select:focus,
.cadastro-card .form-textarea:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,168,89,0.12);
}
.cadastro-card .form-input.error {
  border-color: #EF4444;
  background: #FEF2F2;
}
.cadastro-card .form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

/* Field helpers/erros compactos */
.cadastro-card .field-helper,
.cadastro-card .field-error {
  font-size: 11px;
  margin-top: 2px;
}

/* Row de 2 colunas mais apertada */
.cadastro-card .form-row {
  gap: 10px;
  margin-bottom: 0;
}

/* Senha: requisitos em grid 2 colunas, com chips ao inves de bullets */
.cadastro-card .password-requirements {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 6px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #F3F4F6;
}
.cadastro-card .password-requirements .requirement {
  font-size: 10.5px;
  gap: 4px;
  color: #6B7280;
}
.cadastro-card .password-requirements .requirement i {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: all .15s ease;
}
/* Quando atendido: bolinha CHEIA verde com check branco dentro */
.cadastro-card .password-requirements .requirement.met {
  color: #16A34A;
  font-weight: 600;
}
.cadastro-card .password-requirements .requirement.met i {
  background-color: #16A34A;
  color: #FFFFFF;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  padding: 1px;
  stroke-width: 3;
}
.cadastro-card .password-strength {
  margin-top: 6px;
}
.cadastro-card .password-strength-bar {
  height: 3px;
}

/* Headers (titulos de step) — visual mais leve */
.cadastro-card h2 {
  letter-spacing: -0.5px;
  color: #111827;
}
.cadastro-card .subtitle {
  color: #6B7280;
}

/* CTA principal: gradiente sutil + sombra */
.cadastro-card .btn.btn-primary.btn-block {
  background: linear-gradient(135deg, #00B85F 0%, var(--primary) 100%);
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,168,89,0.25);
  border-radius: 10px;
}
.cadastro-card .btn.btn-primary.btn-block:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,168,89,0.35);
}

/* "Voltar" arrow no topo do card — visual de chip */
.cadastro-card .card-back-btn {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #6B7280 !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
  margin-bottom: 8px !important;
}
.cadastro-card .card-back-btn:hover {
  background: #F3F4F6 !important;
  color: #111827 !important;
}

/* Toggle de senha (olho) */
.cadastro-card .password-toggle {
  color: #9CA3AF;
}
.cadastro-card .password-toggle:hover {
  color: var(--primary);
}

/* Field error com icone */
.cadastro-card .field-error {
  color: #DC2626;
  font-weight: 500;
}

/* Footer "Ja tem conta?" */
.cadastro-card .login-footer {
  margin-top: 18px !important;
  font-size: 12.5px !important;
}

/* Padding lateral mais enxuto do card direito */
.login-right:has(.cadastro-card) {
  padding: 28px 32px;
}

/* Botoes do form com altura menor */
.cadastro-card .btn-block {
  padding: 11px 16px;
  font-size: 14px;
}

/* Checkbox de termos compacto */
.cadastro-card .checkbox-label {
  font-size: 12.5px;
  gap: 10px;
}

/* Step 1 (escolha de tipo): cards menores */
.cadastro-card .selection-cards {
  gap: 10px;
  margin: 14px 0 4px;
}
.cadastro-card .selection-card {
  padding: 14px 16px;
  gap: 14px;
}
.cadastro-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.cadastro-card .card-icon i {
  width: 20px;
  height: 20px;
}
.cadastro-card .selection-card h3 {
  font-size: 14px;
}
.cadastro-card .selection-card p {
  font-size: 12px;
}

/* Volta a 1 coluna em telas pequenas */
@media (max-width: 540px) {
  .cadastro-card .form-row {
    flex-direction: column;
    gap: 0;
  }
  .cadastro-card .password-requirements {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Mini Seletor de Tipo — breadcrumb visual no
   topo dos steps 2 e 3. Selecionado destacado,
   outros opacos (mas clicaveis pra trocar).
   ============================================ */
.type-mini-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px;
  background: #F9FAFB;
  border-radius: 10px;
  border: 1px solid #F3F4F6;
  /* Stick to top of card while scrolling form */
  position: sticky;
  top: -1px;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(249, 250, 251, 0.95);
}
.type-mini-selector .mini-type {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: #9CA3AF;
  opacity: 0.45;
  transition: all .15s ease;
}
.type-mini-selector .mini-type:hover {
  opacity: 0.75;
  background: #FFFFFF;
}
.type-mini-selector .mini-type i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.type-mini-selector .mini-type.active {
  opacity: 1;
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: default;
}
.type-mini-selector .mini-type.active:hover {
  background: #FFFFFF;
}

/* Em telas estreitas, esconder labels e deixar só icones */
@media (max-width: 480px) {
  .type-mini-selector .mini-type span {
    display: none;
  }
  .type-mini-selector .mini-type {
    padding: 8px;
  }
  .type-mini-selector .mini-type i {
    width: 16px;
    height: 16px;
  }
}
