/* ============================================================
   style.css — Design System Grandino
   Mobile-first · Dark Mode · Verde Neon #4AFFC5
   Fonte: Sora (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&display=swap');

/* Ocultar badge reCAPTCHA v3 — aviso legal exibido no formulário */
.grecaptcha-badge { visibility: hidden !important; }

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
  --bg:          #000000;
  --bg-card:     #0a0a0a;
  --bg-input:    #111111;
  --border:      rgba(74, 255, 197, 0.15);
  --border-focus:rgba(74, 255, 197, 0.6);
  --accent:      #4AFFC5;
  --accent-dim:  rgba(74, 255, 197, 0.08);
  --accent-glow: rgba(74, 255, 197, 0.25);
  --text:        #E5E7F1;
  --text-muted:  rgba(229, 231, 241, 0.5);
  --text-faint:  rgba(229, 231, 241, 0.3);
  --danger:      #FF4D6A;
  --warning:     #FFB830;
  --success:     #4AFFC5;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 32px rgba(0,0,0,0.6);
  --transition:  all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background decorativo ─────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(74,255,197,0.04) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(74,255,197,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 40px;
}

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
  width: 100%;
  max-width: 680px;
  padding: 28px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Logo — SVG oficial Grandino (528×91 · fundo transparente) */
.logo-img {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.logo-text span {
  color: var(--accent);
}

.header-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* reCAPTCHA v3 — aviso legal obrigatório (badge oculto) */
.recaptcha-legal {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
.recaptcha-legal a {
  color: rgba(255,255,255,0.5);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .logo-img { max-width: 160px; }
}


/* ── Progress Bar ───────────────────────────────────────────── */
.progress-container {
  width: 100%;
  max-width: 680px;
  margin: 16px 0 24px;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  transform: translateY(-50%);
  z-index: 0;
}

.progress-line {
  position: absolute;
  top: 50%;
  left: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(74,255,197,0.4));
  transform: translateY(-50%);
  z-index: 1;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px var(--accent-glow);
}

.step-dot {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.15);
  background: var(--bg-card);
  color: rgba(255,255,255,0.4);
  transition: var(--transition);
  flex-shrink: 0;
}

.step-dot.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.step-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* Ícones SVG inline nos dots — sem emoji que rendem em roxo */
.step-dot .dot-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-dot .dot-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.step-dot.done .dot-icon svg { stroke: #000; }
.step-dot .dot-num  { display: none; }

.step-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.step-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  width: 44px;
  transition: color 0.25s;
  overflow: hidden;
  white-space: nowrap;
}

.step-label.active { color: var(--accent); font-weight: 600; }
.step-label.done   { color: rgba(255,255,255,0.65); }

/* ── Card Principal ─────────────────────────────────────────── */
.form-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Steps ──────────────────────────────────────────────────── */
.step-panel {
  display: none;
  animation: fadeSlideIn 0.35s cubic-bezier(0.4,0,0.2,1);
}

.step-panel.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.step-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 24px;
}

/* ── Form Fields ────────────────────────────────────────────── */
.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

label .req {
  color: var(--accent);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  transition: var(--transition);
  outline: none;
  min-height: 48px;                          /* touch target */
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 12px var(--accent-glow);
  background: rgba(74,255,197,0.03);
}

input.error, select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255,77,106,0.1);
}

input:disabled, input[readonly] {
  opacity: 0.55;
  cursor: not-allowed;
}

input[readonly].filled {
  border-color: rgba(74,255,197,0.3);
  color: var(--accent);
  opacity: 1;
}

.field-hint {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

.field-error {
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: 2px;
  display: none;
}

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

/* CNPJ loading + lock icon */
.cnpj-wrapper {
  position: relative;
}

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

.cnpj-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.cnpj-icon.loading { animation: spin 0.8s linear infinite; }
.cnpj-icon.locked  { color: var(--accent); }

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Sócios ─────────────────────────────────────────────────── */
.socio-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  animation: fadeSlideIn 0.3s ease;
}

.socio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.socio-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-remove-socio {
  background: rgba(255,77,106,0.1);
  border: 1px solid rgba(255,77,106,0.3);
  color: var(--danger);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Sora', sans-serif;
  min-height: 32px;
}

.btn-remove-socio:hover {
  background: rgba(255,77,106,0.2);
}

.btn-add-socio {
  width: 100%;
  background: transparent;
  border: 1px dashed rgba(74,255,197,0.3);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Sora', sans-serif;
  margin-top: 4px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add-socio:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.btn-add-socio:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Upload ─────────────────────────────────────────────────── */
.upload-area {
  border: 1.5px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.upload-label {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.upload-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.upload-info {}

.upload-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.upload-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.upload-preview {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  display: none;
}

.upload-preview.visible { display: flex; }
.upload-preview .file-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* ── LGPD ───────────────────────────────────────────────────── */
.lgpd-box {
  background: rgba(74,255,197,0.04);
  border: 1px solid rgba(74,255,197,0.15);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 8px;
}

.lgpd-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.lgpd-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  min-width: 20px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent);
  margin-top: 2px;
  border: none;
  background: none;
  padding: 0;
}

.lgpd-text {
  font-size: 0.78rem;
  color: #ffffff;
  line-height: 1.5;
}

.lgpd-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Botões de Navegação ────────────────────────────────────── */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}

.btn-prev {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
  flex: 0 0 auto;
}

.btn-prev:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--text);
}

.btn-next {
  background: linear-gradient(135deg, var(--accent), #22e6a4);
  border: none;
  color: #000;
  border-radius: var(--radius-sm);
  padding: 13px 32px;
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
  flex: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(74,255,197,0.3);
}

.btn-next:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(74,255,197,0.45);
}

.btn-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-next.loading {
  position: relative;
  color: transparent;
}

.btn-next.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin2 0.7s linear infinite;
}

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

/* ── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--text);
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-color: var(--accent); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Tela de Sucesso ─────────────────────────────────────────── */
#screen-success {
  display: none;
  text-align: center;
  padding: 20px 0;
}

#screen-success.active { display: block; }

.success-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(74,255,197,0.1);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 24px;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

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

.success-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.success-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto;
}

/* ── Footer ─────────────────────────────────────────────────── */
.app-footer {
  width: 100%;
  max-width: 680px;
  text-align: center;
  padding: 20px 0 0;
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* ── Responsive — Tablet (≥768px) ───────────────────────────── */
@media (min-width: 768px) {
  .app-wrapper { padding: 0 24px 60px; }

  .form-card { padding: 40px 40px; }

  .field-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .step-label { font-size: 0.72rem; }
}

/* ── Responsive — Desktop (≥1024px) ─────────────────────────── */
@media (min-width: 1024px) {
  .app-header { padding: 40px 0 24px; }
  .form-card  { padding: 48px 48px; }
}

/* ── Mobile melhorias ────────────────────────────────────────── */
@media (max-width: 480px) {
  .step-dot { width: 36px; height: 36px; font-size: 0.65rem; }
  .step-label { font-size: 0.6rem; width: 36px; }

  .nav-buttons {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, var(--bg) 60%, transparent);
    padding: 16px 0 0;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ── Preenchimento manual (CNPJ não encontrado) ── */
.manual-entry-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,184,48,0.08);
  border: 1px solid rgba(255,184,48,0.35);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  color: #FFB830;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}
.manual-entry-banner span:first-child { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

input.manual-entry,
select.manual-entry {
  border-color: rgba(255,184,48,0.4) !important;
}
input.manual-entry:focus,
select.manual-entry:focus {
  border-color: #FFB830 !important;
  box-shadow: 0 0 0 3px rgba(255,184,48,0.1) !important;
}
