/* ─────────────────────────────────────────────────────
   iDocs – Cadastro de Cliente  |  style.css
   Suporte a tema Escuro e Claro via data-theme
───────────────────────────────────────────────────── */

/* ── Tema Escuro (padrão) ── */
:root,
[data-theme="dark"] {
  --bg-body:        #040d1f;
  --bg-header:      rgba(4, 13, 31, 0.88);
  --bg-card:        linear-gradient(160deg, rgba(17,38,73,.92) 0%, rgba(7,20,40,.97) 100%);
  --bg-card-header: linear-gradient(135deg, #112649 0%, #071428 100%);
  --bg-input:       rgba(244, 247, 255, 0.06);
  --bg-input-focus: rgba(0, 87, 255, 0.08);
  --bg-input-error: rgba(255, 77, 109, 0.06);
  --bg-particle:    rgba(0, 87, 255, 0.18);

  --text-primary:   #f4f7ff;
  --text-secondary: rgba(244, 247, 255, 0.68);
  --text-muted:     rgba(244, 247, 255, 0.35);
  --text-label:     rgba(244, 247, 255, 0.5);

  --border:         rgba(244, 247, 255, 0.1);
  --border-focus:   rgba(0, 87, 255, 0.7);
  --border-input:   rgba(244, 247, 255, 0.12);

  --blue:           #0057ff;
  --blue-light:     #3378ff;
  --blue-glow:      rgba(0, 87, 255, 0.18);
  --accent:         #00c2ff;
  --error:          #ff4d6d;
  --success:        #00e5a0;

  --shadow-card:    0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(244,247,255,0.07);

  --toggle-bg:      rgba(244,247,255,0.1);
  --toggle-border:  rgba(244,247,255,0.15);
  --toggle-thumb:   #1a3460;
  --toggle-text:    rgba(244,247,255,0.55);

  --select-arrow:   %23ffffff55;
  --select-option-bg: #071428;

  --footer-text:    rgba(244, 247, 255, 0.18);
}

/* ── Tema Claro ── */
[data-theme="light"] {
  --bg-body:        #f0f4ff;
  --bg-header:      rgba(255, 255, 255, 0.92);
  --bg-card:        linear-gradient(160deg, #ffffff 0%, #f5f8ff 100%);
  --bg-card-header: linear-gradient(135deg, #dce8ff 0%, #edf3ff 100%);
  --bg-input:       rgba(0, 0, 0, 0.03);
  --bg-input-focus: rgba(0, 87, 255, 0.05);
  --bg-input-error: rgba(255, 77, 109, 0.05);
  --bg-particle:    rgba(0, 87, 255, 0.07);

  --text-primary:   #0b1a35;
  --text-secondary: rgba(11, 26, 53, 0.7);
  --text-muted:     rgba(11, 26, 53, 0.4);
  --text-label:     rgba(11, 26, 53, 0.5);

  --border:         rgba(0, 0, 0, 0.08);
  --border-focus:   rgba(0, 87, 255, 0.5);
  --border-input:   rgba(0, 0, 0, 0.12);

  --blue:           #0057ff;
  --blue-light:     #1a5fff;
  --blue-glow:      rgba(0, 87, 255, 0.12);
  --accent:         #0099cc;
  --error:          #e0002e;
  --success:        #007a50;

  --shadow-card:    0 20px 60px rgba(0,60,180,0.1), 0 0 0 1px rgba(0,0,0,0.06);

  --toggle-bg:      #e2eaff;
  --toggle-border:  #c0d0ff;
  --toggle-thumb:   #ffffff;
  --toggle-text:    rgba(11, 26, 53, 0.6);

  --select-arrow:   %2300000055;
  --select-option-bg: #ffffff;

  --footer-text:    rgba(11, 26, 53, 0.3);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Particles ── */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-particles span {
  position: absolute;
  border-radius: 50%;
  background: var(--bg-particle);
  filter: blur(60px);
  animation: floatParticle linear infinite;
}
.bg-particles span:nth-child(1)  { width:400px;height:400px;left:-10%;top:5%;animation-duration:20s;opacity:.5; }
.bg-particles span:nth-child(2)  { width:250px;height:250px;right:-5%;top:20%;animation-duration:28s;opacity:.4; }
.bg-particles span:nth-child(3)  { width:320px;height:320px;left:30%;bottom:0;animation-duration:24s;opacity:.3; }
.bg-particles span:nth-child(4)  { width:180px;height:180px;right:20%;bottom:15%;animation-duration:18s;opacity:.4; }
.bg-particles span:nth-child(5)  { width:120px;height:120px;left:60%;top:40%;animation-duration:32s;opacity:.25; }
.bg-particles span:nth-child(6)  { width:500px;height:200px;left:5%;top:50%;animation-duration:36s;opacity:.2; }
.bg-particles span:nth-child(7)  { width:150px;height:150px;right:40%;top:10%;animation-duration:22s;opacity:.25; }
.bg-particles span:nth-child(8)  { width:300px;height:300px;right:-8%;bottom:5%;animation-duration:26s;opacity:.25; }

@keyframes floatParticle {
  0%   { transform: translateY(0) scale(1); }
  50%  { transform: translateY(-40px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: color 0.3s ease;
}
.logo-text em { font-style: normal; color: var(--blue-light); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Theme Toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  border-radius: 24px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }

.toggle-track {
  width: 32px;
  height: 20px;
  background: var(--blue-glow);
  border: 1px solid var(--border-focus);
  border-radius: 20px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s ease;
  color: #fff;
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(12px);
  background: var(--blue);
}

.icon-moon { display: block; }
.icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: block; }

.toggle-label {
  font-family: 'Sora', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--toggle-text);
  white-space: nowrap;
  transition: color 0.3s ease;
  user-select: none;
}

/* ── WhatsApp button ── */
.header-whatsapp {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Sora', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(0,194,255,.3);
  border-radius: 20px;
  padding: 6px 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.header-whatsapp:hover {
  background: rgba(0,194,255,.1);
  border-color: rgba(0,194,255,.5);
}

/* ── Main ── */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ── Card ── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: cardReveal .6s cubic-bezier(0.4,0,0.2,1) both;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card Header ── */
.card-header {
  padding: 44px 48px 36px;
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.card-header::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: var(--blue-glow);
  filter: blur(50px);
  pointer-events: none;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Sora', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(0,194,255,.3);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 16px;
}
.card-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.8); }
}

.card-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 14px;
  transition: color 0.3s ease;
}
.card-divider {
  width: 50px; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  border-radius: 2px;
  margin-bottom: 18px;
}
.card-subtitle {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue-light);
  margin-bottom: 10px;
}
.card-desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 14px;
  transition: color 0.3s ease;
}
.card-contact {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}
.card-contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(0,194,255,.3);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.card-contact a:hover { color: var(--blue-light); border-color: var(--accent); }

/* ── Form ── */
#cadastroForm { padding: 40px 48px; }

.form-section { border: none; margin-bottom: 40px; }

.section-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Sora', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.legend-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--blue-glow);
  border: 1px solid var(--border-focus);
  font-family: 'Sora', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-light);
  flex-shrink: 0;
}

.field-group {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.field {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
  position: relative;
}
.field--half  { flex: 0 1 240px; }
.field--short { flex: 0 1 130px; }
.field--grow  { flex: 2 1 260px; }

.field label {
  font-family: 'Sora', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}
.field:focus-within label { color: var(--blue-light); }
.req { color: var(--blue-light); }

.field input,
.field select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  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='%2300000066' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
[data-theme="dark"] .field select {
  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='%23ffffff55' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
.field select option { background: var(--select-option-bg); color: var(--text-primary); }
.field input::placeholder { color: var(--text-muted); }

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.field input.error,
.field select.error {
  border-color: var(--error);
  background: var(--bg-input-error);
}
.field-error {
  font-size: 0.73rem;
  color: var(--error);
  margin-top: 5px;
  display: none;
  font-weight: 500;
}
.field.has-error .field-error { display: block; }

/* ── Form footer ── */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s ease;
}
.footer-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* ── Submit button ── */
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, #0041cc 100%);
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,87,255,.4);
}
.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,87,255,.6); }
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-loader svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-arrow { transition: transform 0.2s ease; }
.btn-submit:hover .btn-arrow { transform: translateX(3px); }

/* ── Success ── */
.success-state {
  padding: 60px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: cardReveal .5s ease both;
}
.success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(0,87,255,.12);
  border: 2px solid rgba(0,87,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.success-state h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.success-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.65;
}
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 24px;
  box-shadow: 0 4px 18px rgba(37,211,102,.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(37,211,102,.5); }

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: var(--footer-text);
  border-top: 1px solid var(--border);
  transition: color 0.3s ease, border-color 0.3s ease;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .card-header,
  #cadastroForm { padding: 28px 22px; }
  .success-state { padding: 40px 22px; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .btn-submit { justify-content: center; }
  .field--half, .field--short { flex: 1 1 120px; }
  .toggle-label { display: none; }
}