/* ============================================================
   CONSÓRCIO PRIME – Estilos Globais
   ============================================================ */

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

:root {
  --primary:      #1a56db;
  --primary-dark: #1342b0;
  --primary-light:#e8f0fe;
  --accent:       #f59e0b;
  --success:      #10b981;
  --danger:       #ef4444;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-400:     #9ca3af;
  --gray-600:     #4b5563;
  --gray-800:     #1f2937;
  --white:        #ffffff;
  --radius:       10px;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.14);
  --transition:   .22s ease;
  --font:         'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- HEADER ---- */
#site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 20px;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -.3px;
}

.brand-name strong { color: var(--primary); }

.brand-tagline {
  display: block;
  font-size: 11px;
  color: var(--gray-400);
  margin-top: -1px;
}

.header-nav { display: flex; gap: 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ---- HERO ---- */
#hero-section {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1a56db 100%);
  padding: 52px 0 42px;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,.04) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(245,158,11,.12) 0%, transparent 50%);
}

.hero-content { position: relative; color: var(--white); }

.hero-content h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 10px;
}

.hero-content p {
  font-size: 15px;
  color: rgba(255,255,255,.75);
  max-width: 580px;
  line-height: 1.6;
}

.required-star { color: #fca5a5; font-weight: 700; }

/* ---- MAIN ---- */
#main-content {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 48px;
}

/* ---- PROGRESS ---- */
#progress-bar-wrap {
  margin-bottom: 32px;
}

.step-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 4px;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
  transition: var(--transition);
  white-space: nowrap;
}

.step-label.active { color: var(--primary); }
.step-label.completed { color: var(--success); }

.step-label i { font-size: 12px; }

.progress-track {
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* ---- FIELDSET / STEP ---- */
.form-step {
  display: none;
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  padding: 36px 40px;
  box-shadow: var(--shadow);
  animation: fadeSlide .3s ease both;
}

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

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-step legend {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary-light);
  width: 100%;
}

/* ---- GRID ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }

/* ---- FORM GROUPS ---- */
.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: .1px;
}

input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

input.invalid, select.invalid, textarea.invalid {
  border-color: var(--danger);
  background: #fff5f5;
}

select { cursor: pointer; }

textarea { resize: vertical; min-height: 100px; }

/* Input com botão */
.input-with-btn {
  display: flex;
  gap: 8px;
}
.input-with-btn input { flex: 1; }

/* Input com prefixo */
.input-prefix {
  display: flex;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-50);
  transition: var(--transition);
}
.input-prefix:focus-within {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.input-prefix.invalid { border-color: var(--danger); }

.prefix {
  padding: 11px 12px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  border-right: 1.5px solid var(--gray-200);
  flex-shrink: 0;
}

.input-prefix input {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 1;
}

.input-prefix input:focus {
  border: none;
  box-shadow: none;
}

/* Erros */
.field-error {
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
  display: block;
}

/* Checkbox */
.terms-group { margin-top: 4px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-600);
}

.checkbox-label input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

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

/* ---- BOTÕES ---- */
.step-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-next, .btn-submit {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(26,86,219,.3);
}

.btn-next:hover, .btn-submit:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 6px 20px rgba(26,86,219,.4);
  transform: translateY(-1px);
}

.btn-back {
  background: var(--gray-100);
  color: var(--gray-600);
}

.btn-back:hover {
  background: var(--gray-200);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

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

/* ---- SUCCESS CARD ---- */
#success-card {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  padding: 52px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeSlide .4s ease both;
}

#success-card.hidden { display: none; }

.success-icon {
  font-size: 72px;
  color: var(--success);
  margin-bottom: 20px;
  animation: popIn .5s cubic-bezier(.175,.885,.32,1.275) both;
}

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

#success-card h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 12px;
}

#success-card p {
  color: var(--gray-600);
  font-size: 15px;
  line-height: 1.7;
  max-width: 500px;
  margin: 0 auto 24px;
}

.success-info {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 0 auto 28px;
  max-width: 420px;
  text-align: left;
  font-size: 14px;
  color: var(--gray-600);
  line-height: 2;
}

.success-info strong { color: var(--gray-800); }

.success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--gray-800);
  color: var(--white);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  animation: slideUp .3s ease;
}

.toast.hidden { display: none; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

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

/* ---- FOOTER ---- */
#site-footer {
  background: var(--gray-800);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  line-height: 1.8;
}

#site-footer strong { color: var(--white); }
.footer-sub { font-size: 12px; opacity: .6; }

/* ---- HIDDEN ---- */
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 680px) {
  .form-step { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .col-1, .col-2 { grid-column: span 1; }
  .step-labels { gap: 0; }
  .step-label { font-size: 11px; gap: 4px; }
  .header-inner { height: 60px; }
  .brand-tagline { display: none; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
  #hero-section { padding: 36px 0 28px; }
  #success-card { padding: 36px 20px; }
}
