:root {
  --primary-color: #003087;
  --secondary-color: #00AEEF;
  --accent-color: #001F5B;
  --background-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --transition-speed: 0.3s;
  --gradient-primary: linear-gradient(135deg, #003087, #00AEEF);
  --divider-gradient: linear-gradient(to right, transparent, var(--secondary-color), transparent);
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
}


body.dark-mode {
  --background-color: #121212;
  --card-bg: #1e1e1e;
  --text-color: #e0e0e0;
  --primary-color: #60A5FA;
  --secondary-color: #1E88E5;
  --gradient-primary: linear-gradient(135deg, #1565C0, #1e88e5);
  --divider-gradient: linear-gradient(to right, transparent, #1e88e5, transparent);
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #F87171;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  padding-top: 80px;
  overflow-x: hidden;
  transition: background-color var(--transition-speed);
}

p,
li,
.accordion-body,
.orientacoes p,
blockquote {
  text-align: justify;
}


header {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1050;
  padding: 0 20px;
  transition: all var(--transition-speed);
}

body.dark-mode header {
  background: rgba(18, 18, 18, 0.95);
  box-shadow: 0 4px 30px rgba(255, 255, 255, 0.1);
}


.logo-container {
  max-height: 80px;
  max-width: 200px;
}

.logo-container img {
  width: 100%;
  height: auto;
}

body:not(.dark-mode) .logo-container img {
  filter: invert(27%) sepia(100%) saturate(5350%) hue-rotate(190deg) brightness(96%) contrast(91%);
}

body.dark-mode .logo-container img {
  filter: brightness(0) invert(1);
}


.navbar-nav .nav-link {
  color: var(--text-color) !important;
  font-weight: 500;
  padding: 0.5rem 1.2rem !important;
  position: relative;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.2rem;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: width var(--transition-speed) ease;
}

.navbar-nav .nav-link:hover::after {
  width: calc(100% - 2.4rem);
}

.dark-mode-toggle {
  cursor: pointer;
  font-size: 1.2rem;
}


.hero {
  min-height: 80vh;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  position: relative;
  padding: 100px 20px 40px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 10%, transparent 11%);
  background-size: 50px 50px;
  animation: grid-animation 20s linear infinite;
}

@keyframes grid-animation {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-50px, -50px);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.hero p {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: 30px;
  max-width: 700px;
  text-align: center;
}

.hero .btn {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  border: 2px solid #fff;
  transition: transform var(--transition-speed);
}

.hero .btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}


.content-section {
  padding: 80px 20px;
  max-width: 1200px;
  margin: auto;
}

.content-section h2,
.content-section h3,
.content-section h4 {
  color: var(--primary-color);
}

.content-section h2 {
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}

.content-section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.content-section h3 {
  font-weight: 700;
}

.divider {
  height: 2px;
  background: var(--divider-gradient);
  margin: 3rem 0;
  border-radius: 2px;
}


.process-step {
  text-align: center;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 15px;
  background: var(--card-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  height: 100%;
  transition: transform 0.3s;
}

.process-step:hover {
  transform: translateY(-5px);
}

body.dark-mode .process-step {
  border-color: #444;
}

.process-step .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  width: 70px;
  height: 70px;
  line-height: 70px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
}

.process-step h4 {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
}

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


.form-section {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.form-label {
  font-weight: 600;
  color: var(--primary-color);
}

.form-control,
.form-select {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  transition: all var(--transition-speed);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
  background-color: #2c2c2c;
  border: 1px solid #444;
  color: #e0e0e0;
}

body.dark-mode .form-control::placeholder {
  color: #a0a0a0;
}

body.dark-mode .text-muted {
  color: #adb5bd !important;
}

blockquote {
  border-left: 5px solid var(--secondary-color);
  padding: 1rem 1.5rem;
  background-color: rgba(0, 174, 239, 0.05);
  border-radius: 0 8px 8px 0;
}

body.dark-mode blockquote p {
  color: var(--text-color);
}

body.dark-mode blockquote {
  background-color: rgba(30, 136, 229, 0.1);
  border-left-color: var(--secondary-color);
}

.cnae-hint-icon {
  font-size: 1rem;
  cursor: help;
  color: #6c757d;
}

body.dark-mode .cnae-hint-icon {
  color: #adb5bd;
}


.accordion-item {
  border-radius: 15px;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  background: var(--card-bg);
}

body.dark-mode .accordion-item {
  border-color: #444;
}

.accordion-button {
  position: relative;
  padding-right: 3.5rem;
  min-height: 70px;
  border-radius: 15px !important;
  font-weight: 600;
  background: var(--card-bg);
  color: var(--primary-color);
  transition: background var(--transition-speed), color var(--transition-speed);
  border: 1px solid transparent;
  text-align: left;
}

.accordion-button:not(.collapsed) {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

body.dark-mode .accordion-button {
  background: var(--card-bg);
  color: var(--text-color);
}

body.dark-mode .accordion-button:not(.collapsed) {
  background: var(--primary-color);
  color: #fff;
}

.accordion-button::after {
  content: none !important;
}

.arrow-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.3s ease;
  color: var(--primary-color);
}

.accordion-button:not(.collapsed) .arrow-icon {
  transform: translateY(-50%) rotate(180deg);
  color: #fff;
}

.accordion-body {
  color: var(--text-color);
}


.vertical-timeline {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 1.75rem;
  border-left: 2px solid var(--secondary-color);
}

.vertical-timeline .timeline-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.vertical-timeline .timeline-step:last-child {
  margin-bottom: 0;
}

.vertical-timeline .timeline-icon {
  position: absolute;
  left: -1.75rem;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.vertical-timeline .timeline-content {
  margin-left: 0.75rem;
  flex: 1;
}

.vertical-timeline .timeline-header {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-speed), color var(--transition-speed);
}

.vertical-timeline .timeline-header:hover {
  background: var(--gradient-primary);
  color: #fff;
}

.vertical-timeline .timeline-subtitle {
  font-size: 0.85rem;
  opacity: 0.8;
}

.vertical-timeline .timeline-arrow i {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.vertical-timeline .timeline-header[aria-expanded="true"] .timeline-arrow i {
  transform: rotate(90deg);
}

.vertical-timeline .timeline-body {
  margin-top: -1px;
  padding: 0.75rem 1rem 1rem 1rem;
  border-left: 2px solid var(--secondary-color);
  border-radius: 0 0 8px 8px;
  background: var(--card-bg);
}


.document-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0.75rem;
}

.document-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.3rem;
}

.document-list li i {
  margin-right: 0.5rem;
  color: var(--secondary-color);
  line-height: 1.2;
}


#step2 h3 {
  color: var(--primary-color);
  font-weight: 700;
}

.result-card {
  background-color: var(--card-bg);
  border-width: 2px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

.result-card .card-header {
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .result-card .card-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.result-card .card-header:not([class*="bg-"]) {
  color: var(--primary-color);
  background-color: transparent;
}

.result-card .card-body h2,
.result-card .card-body p,
.result-card .card-body h4 {
  color: var(--text-color);
}

.result-card .card-body h2 {
  font-weight: 800;
}

.result-card .card-body .icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.form-estabelecimento-title {
  display: flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: 700;
}

.form-estabelecimento-title i {
  color: var(--primary-color);
}

.form-estabelecimento-grid {
  margin-top: 0.25rem;
}

.form-estabelecimento-grid .form-label {
  margin-bottom: 0.45rem;
}

.form-label-icon {
  color: var(--primary-color);
}

.form-atividades-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.form-atividades-title {
  display: flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: 700;
}

.form-atividades-title i {
  color: var(--primary-color);
}

.form-atividades-hint {
  margin-top: 0.1rem;
}

.result-details-block {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 1rem;
}

.result-estabelecimento-block {
  padding: 1.15rem 1.25rem;
}

.result-estabelecimento-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  font-weight: 700;
}

.result-estabelecimento-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 48, 135, 0.12);
  color: var(--primary-color);
  flex-shrink: 0;
}

.result-estabelecimento-fields {
  display: grid;
  gap: 0.9rem;
}

.result-estabelecimento-field {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.result-estabelecimento-field:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.result-estabelecimento-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--primary-color);
}

.result-estabelecimento-label-icon {
  width: 1rem;
  text-align: center;
}

.result-estabelecimento-value {
  margin: 0;
}

.result-estabelecimento-cnaes > ul {
  margin-bottom: 0;
}

.result-estabelecimento-cnaes li:last-child {
  margin-bottom: 0 !important;
}

.afe-orientacao-alert {
  border-left: 4px solid #f0ad4e;
}

.afe-orientacao-alert .afe-links {
  font-size: 0.95rem;
}

.afe-orientacao-alert .afe-links ul {
  padding-left: 1.15rem;
}

.afe-orientacao-alert .afe-links a {
  font-weight: 600;
}

body.dark-mode .result-details-block {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .result-estabelecimento-field {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

body.dark-mode .result-estabelecimento-icon {
  background: rgba(96, 165, 250, 0.22);
  color: #cbe3ff;
}

body.dark-mode .afe-orientacao-alert {
  background-color: rgba(255, 193, 7, 0.18);
  border-color: rgba(255, 193, 7, 0.56);
  color: var(--text-color);
}

body.dark-mode .afe-orientacao-alert .afe-links a {
  color: #ffe08a;
}

body.dark-mode .afe-orientacao-alert .afe-links a:hover {
  color: #fff3bf;
}

body.dark-mode #result .list-group-item {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-color);
}

body.dark-mode #result .list-group-item .text-primary,
body.dark-mode #result h6.text-secondary {
  color: #dbe7f3 !important;
}

body.dark-mode #result .list-group-item.border-info {
  border-left-color: #62c5f8 !important;
}

body.dark-mode #result .list-group-item.border-warning {
  border-left-color: #ffd166 !important;
}

body.dark-mode #result .btn-outline-primary {
  color: #8fd7ff;
  border-color: #8fd7ff;
}

body.dark-mode #result .btn-outline-primary:hover {
  background-color: #8fd7ff;
  color: #102236;
}

body.dark-mode #result .btn-outline-warning {
  color: #ffd166;
  border-color: #ffd166;
}

body.dark-mode #result .btn-outline-warning:hover {
  background-color: #ffd166;
  color: #2f2500;
}

.cnae-card {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  background: var(--card-bg);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cnae-card .select-container {
  flex: 1;
}

.cnae-info-icon {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-left: 10px;
  cursor: pointer;
  transition: color 0.3s;
}

.cnae-card .delete-btn {
  width: 38px;
  height: 38px;
  margin-left: 10px;
}


footer {
  background: var(--background-color);
  color: var(--text-color);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #e2e8f0;
}

body:not(.dark-mode) footer a {
  color: #1e293b;
}

body.dark-mode footer {
  background: #1e1e1e;
  border-top-color: #444;
}

body.dark-mode footer .footer-logo {
  filter: brightness(0) invert(1);
}

body:not(.dark-mode) footer .footer-logo {
  filter: invert(1);
}

footer .info-text {
  font-family: Arial, sans-serif;
}

.footer-version {
  width: 100%;
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-color);
  opacity: 0.45;
}

body.dark-mode .footer-version {
  border-top-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .navbar-brand {
    margin: 0 auto;
  }
}


.select2-container--default .select2-selection--single {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  height: auto;
  min-height: 48px;
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  transition: all var(--transition-speed);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-color);
  line-height: 1.5;
  padding-left: 1.25rem;
  background: transparent !important;
  white-space: normal;
  padding-top: 5px;
  padding-bottom: 5px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 48px;
  right: 10px;
}

.select2-dropdown {
  background-color: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.select2-search--dropdown .select2-search__field {
  background-color: var(--card-bg);
  color: var(--text-color);
  border-color: #e2e8f0;
}

.select2-results__option {
  color: var(--text-color);
}

body.dark-mode .select2-container--default .select2-selection--single {
  background-color: #2c2c2c !important;
  border: 1px solid #444;
}

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #e0e0e0 !important;
}

body.dark-mode .select2-dropdown {
  background-color: #2c2c2c;
  border: 1px solid #444;
}

body.dark-mode .select2-results__option {
  color: var(--text-color);
}

body.dark-mode .select2-search--dropdown .select2-search__field {
  background-color: #333;
  border-color: #444;
}

.select2-results__option--highlighted {
  background: var(--primary-color) !important;
  color: #fff !important;
}

.modal-body h5 {
  color: var(--primary-color);
  font-weight: bold;
}

body.dark-mode .modal-content {
  background-color: var(--card-bg);
  color: var(--text-color);
}

body.dark-mode .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body .notas-content {
  white-space: pre-wrap;
}

.hero-img {
  max-width: 280px;
}

.footer-logo-img {
  height: 70px;
}

.hidden-initially {
  display: none;
}

.hidden { display: none !important; }

.visa-card { background-color: var(--card-bg); color: var(--text-color); }
body.dark-mode .visa-card h6,
body.dark-mode .visa-card p { color: var(--text-color); }
body.dark-mode .visa-card p a { color: #6edff6; }

@keyframes highlightNew {
  0% {
    background-color: rgba(0, 174, 239, 0.2);
    transform: scale(0.98);
  }

  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

.highlight-new {
  animation: highlightNew 0.8s ease-out;
  border-radius: 8px;
}

.ui-stepper {
  display: flex;
  gap: 15px;
  margin: 0 auto 2rem auto;
  max-width: 600px;
}

.ui-stepper .step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #adb5bd;
  transition: all var(--transition-speed);
  font-weight: 500;
}

.ui-stepper .step.active {
  color: var(--primary-color);
  font-weight: 700;
}

.ui-stepper .step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-speed);
}

.ui-stepper .step.active .step-icon {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 48, 135, 0.2);
}

.ui-stepper .step-divider {
  flex: 1;
  height: 2px;
  background: #e9ecef;
  border-radius: 2px;
  transition: background var(--transition-speed);
}

.ui-stepper:has(.step:nth-child(3).active) .step-divider {
  background: var(--primary-color);
}

body.dark-mode .ui-stepper .step {
  color: #6c757d;
}

body.dark-mode .ui-stepper .step.active {
  color: #60A5FA;
}

body.dark-mode .ui-stepper .step-icon {
  background: #333;
}

body.dark-mode .ui-stepper .step.active .step-icon {
  background: #60A5FA;
  color: #121212;
  box-shadow: 0 4px 10px rgba(96, 165, 250, 0.2);
}

body.dark-mode .ui-stepper .step-divider {
  background: #444;
}

.hidden-transition {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}
@keyframes fadeInSoft {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInSoft 0.35s ease-out; }
