:root {
  /* ===== CORES PRINCIPAIS (FÁCIL DE TROCAR) ===== */
  --primary-color: #053f7b;
  --primary-hover: #043463;
  --primary-light: #dbe9f7;
  --secondary-color: #0b5aa7;
  --accent-color: #1c78d6;

  /* ===== CORES DE FEEDBACK ===== */
  --success-color: #0b5aa7;
  --success-light: #dbe9f7;
  --error-color: #dc2626;
  --error-light: #fee2e2;
  --warning-color: #f59e0b;

  /* ===== CORES NEUTRAS ===== */
  --background: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --divider-color: #b9d4f2;

  /* ===== TIPOGRAFIA ===== */
  --font-family: 'Inter', sans-serif;
  --font-size-base: 16px;

  /* ===== ESPAÇAMENTOS ===== */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* ===== BORDAS ===== */
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 28px;

  /* ===== SOMBRAS ===== */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.18);

  /* ===== TRANSIÇÕES ===== */
  --transition: 220ms ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--background);
  min-height: 100vh;
  line-height: 1.6;
}

.a11y-toolbar {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(5, 63, 123, 0.2);
}

.a11y-toolbar.is-open {
  display: flex;
}

.a11y-fab {
  position: fixed;
  bottom: 20px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 11;
  gap: 10px;
  padding: 0 18px;
}

.a11y-fab i {
  width: 22px;
  height: 22px;
}

.a11y-fab img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.a11y-fab-label {
  display: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.a11y-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(5, 63, 123, 0.12), rgba(185, 212, 242, 0.6));
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(5, 63, 123, 0.15);
  border: 1px solid rgba(5, 63, 123, 0.25);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.a11y-badge i {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
}

.a11y-badge .lucide {
  width: 16px;
  height: 16px;
}

.a11y-badge-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  filter: brightness(0);
}

.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(5, 63, 123, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #f8fff9 100%);
  cursor: pointer;
  min-height: 44px;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.a11y-btn i {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
}

.a11y-btn .lucide {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
  background: rgba(5, 63, 123, 0.12);
  border-radius: 10px;
  padding: 6px;
  border: 1px solid rgba(5, 63, 123, 0.2);
}

.a11y-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.a11y-btn[aria-pressed="true"] {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: inset 0 0 0 1px rgba(5, 63, 123, 0.25);
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fff;
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--primary-color);
  transform: translateY(-200%);
  transition: var(--transition);
  z-index: 5;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: #fff;
  padding: 12px 14px;
  min-height: 50px;
  transition: var(--transition);
  color: var(--text-primary);
}

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

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(5, 63, 123, 0.16);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 6px rgba(5, 63, 123, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 24px) calc(50% - 2px),
    calc(100% - 18px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.background-decoration {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.6;
  animation: float 12s ease-in-out infinite;
}

.shape-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(5, 63, 123, 0.22), transparent 70%);
  top: -120px;
  right: -120px;
}

.shape-2 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(11, 90, 167, 0.2), transparent 70%);
  bottom: -120px;
  left: -120px;
  animation-delay: 2s;
}

.shape-3 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(11, 90, 167, 0.18), transparent 70%);
  top: 30%;
  left: 12%;
  animation-delay: 4s;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md) var(--spacing-2xl);
}

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  justify-content: center;
}

.logo-badge {
  width: clamp(140px, 28vw, 240px);
  height: clamp(140px, 28vw, 240px);
  border-radius: 0;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-text h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  gap: 4px;
  align-items: baseline;
  color: var(--text-primary);
}

.logo-text h1 span {
  color: var(--primary-color);
  font-weight: 900;
}

.logo-text p {
  color: var(--text-muted);
  font-weight: 500;
}

.form-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-2xl) var(--spacing-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

.form-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.form-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.form-header p {
  color: var(--text-secondary);
}

.progress-container {
  margin-bottom: var(--spacing-xl);
}

.progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: var(--transition);
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: grid;
  place-items: center;
  position: relative;
  background: #fff;
  transition: var(--transition);
}

.step-circle i {
  width: 18px;
  height: 18px;
}

.step-number {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--border-color);
  color: var(--text-secondary);
}

.progress-step.active {
  color: var(--text-primary);
  font-weight: 600;
}

.progress-step.active .step-circle {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 6px rgba(5, 63, 123, 0.15);
}

.progress-step.completed .step-circle {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.progress-step.completed .step-number {
  background: #fff;
  color: var(--primary-color);
}

.form-step {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

.step-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.step-title i {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
}

.step-title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-title p {
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}

fieldset.form-group {
  border: 0;
  padding: 0;
  margin: 0;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.form-group label i {
  width: 18px;
  height: 18px;
}

.full-width {
  grid-column: 1 / -1;
}

.flex-2 {
  grid-column: span 2;
}

.small {
  max-width: 200px;
}

.input-help {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.required {
  color: var(--error-color);
  margin-left: 4px;
}

.optional {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.input-with-button {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.input-with-button input {
  flex: 1 1 auto;
  min-width: 0;
}

.input-with-button .btn-icon {
  flex: 0 0 48px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.info-box {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  background: var(--primary-light);
  color: var(--text-secondary);
}

.info-box i {
  margin-top: 2px;
  color: var(--primary-color);
}

.divider {
  margin: var(--spacing-lg) 0;
  border-top: 1px dashed var(--divider-color);
  position: relative;
  text-align: center;
}

.divider span {
  position: relative;
  top: -12px;
  background: #fff;
  padding: 0 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.radio-group {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 44px;
}

.radio-option input {
  display: none;
}

.radio-custom {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--border-color);
  position: relative;
  display: inline-block;
  transition: var(--transition);
}

.radio-option input:checked+.radio-custom {
  border-color: var(--primary-color);
}

.radio-option input:checked+.radio-custom::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--primary-color);
  border-radius: 999px;
}

.radio-text {
  font-weight: 600;
  color: var(--text-secondary);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  display: inline-grid;
  place-items: center;
  transition: var(--transition);
}

.checkbox-container input:checked+.checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-container input:checked+.checkmark::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 3px;
}

.checkbox-text {
  color: var(--text-secondary);
  font-weight: 500;
}

.link {
  color: var(--primary-color);
  text-decoration: underline;
}

.form-navigation {
  display: flex;
  gap: var(--spacing-md);
  justify-content: space-between;
  margin-top: var(--spacing-xl);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  min-height: 50px;
}

.btn-primary {
  background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-secondary);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-success {
  background: linear-gradient(120deg, var(--accent-color), var(--success-color));
  color: #fff;
}

.btn-success:hover {
  transform: translateY(-2px) scale(1.01);
}

.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  min-height: 18px;
}

.input-error {
  border-color: var(--error-color);
  background: var(--error-light);
  animation: shake 0.2s ease-in-out 2;
}

.input-success {
  border-color: var(--success-color);
  background: var(--success-light);
}

.hidden {
  display: none;
}

.responsavel-fields.hidden {
  display: none;
}

.footer {
  text-align: center;
  margin-top: var(--spacing-xl);
  color: var(--text-muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: #fff;
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  text-align: center;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto var(--spacing-md);
}

.modal-icon.success {
  background: var(--success-light);
  color: var(--success-color);
}

.modal-icon.error {
  background: var(--error-light);
  color: var(--error-color);
}

.modal-error {
  text-align: left;
  max-width: 520px;
}

.modal-error h3,
.modal-error p {
  text-align: left;
}

.modal-error-list {
  margin: var(--spacing-md) 0 var(--spacing-lg);
  padding-left: 20px;
  color: var(--text-secondary);
  display: grid;
  gap: var(--spacing-xs);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  background: #fff;
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: var(--spacing-sm);
  place-items: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-16px);
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }

  33% {
    transform: translateX(-4px);
  }

  66% {
    transform: translateX(4px);
  }

  100% {
    transform: translateX(0);
  }
}

@media (min-width: 768px) {
  .container {
    padding: var(--spacing-2xl) var(--spacing-xl) 80px;
  }

  .form-card {
    padding: var(--spacing-2xl);
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .small {
    max-width: unset;
  }

  .form-navigation {
    flex-wrap: nowrap;
  }
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .flex-2 {
    grid-column: 1 / -1;
  }

  .small {
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .form-card {
    padding: 60px;
  }

  .progress-steps {
    gap: var(--spacing-lg);
  }

  .form-header h2 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .logo-badge {
    width: clamp(180px, 60vw, 260px);
  }

  .a11y-toolbar {
    position: static;
    transform: none;
    display: none;
    width: 100%;
    margin: var(--spacing-lg) 0 var(--spacing-xl);
  }

  .a11y-toolbar.is-open {
    display: flex;
  }

  .a11y-badge {
    width: 100%;
    justify-content: center;
  }

  .a11y-fab {
    position: static;
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    padding: 12px 16px;
    justify-content: flex-start;
    margin-bottom: var(--spacing-md);
  }

  .a11y-fab-label {
    display: inline;
  }
}

:focus-visible {
  outline: 3px solid rgba(5, 63, 123, 0.45);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border-color: #94a3b8;
    --text-muted: #475569;
  }

  input,
  select,
  textarea {
    border-width: 2px;
  }

  .btn-secondary {
    border: 2px solid var(--text-secondary);
  }
}

body.high-contrast {
  --background: #ffffff;
  --card-bg: #ffffff;
  --text-primary: #000000;
  --text-secondary: #111827;
  --text-muted: #374151;
  --border-color: #111827;
}

body.high-contrast .form-card,
body.high-contrast .a11y-badge,
body.high-contrast .a11y-btn {
  box-shadow: none;
  border-width: 2px;
}
