/* =========================================================
   RESET
========================================================= */

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


/* =========================================================
   BASE / TIPOGRAFIA
========================================================= */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 15px;
  background: #f9fafb;
  color: #1f2937;
  line-height: 1.65;
  letter-spacing: -0.15px;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-top: 28px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
  background: #f1ede7;
  border-bottom: 1px solid #e2dbd2;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  position: relative;
  z-index: 10;
}

.header-content {
  padding: 18px 24px;
}

.logo {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #111827;
}

.header-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: #8b8b8b;
  margin-top: 3px;
}


/* =========================================================
   HERO / INTRODUÇÃO
========================================================= */

#hero {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e6e0d8;
  text-align: center;
}

#hero h1 {
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #6b7280;
  margin-bottom: 12px;
}

#hero p {
  font-size: 16px;
  font-weight: 400;
  color: #374151;
  max-width: 720px;
  margin: 0 auto;
  text-align: justify;
  line-height: 1.8;
}

/* =========================================================
   SECTION
========================================================= */

.section-text {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e6e0d8;
  text-align: center;
}

.section-text h2 {
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #6b7280;
  margin-bottom: 12px;
  line-height: 1.3;
  margin-top: 4px;
}

.section-text p {
  font-size: 16px;
  font-weight: 400;
  color: #374151;
  max-width: 720px;
  margin: 0 auto;
  text-align: justify;
  line-height: 1.8;
  margin-bottom: 16px;
}

.section-text + .section-text {
  margin-top: 40px;
}

/* =========================================================
   LAYOUT PRINCIPAL
========================================================= */

#app-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}


/* =========================================================
   CARDS
========================================================= */

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 22px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 10px 30px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.06),
    0 14px 36px rgba(0,0,0,0.05);
}

.card h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
  color: #111827;
  line-height: 1.3;
}

.card h2 strong {
  font-weight: 700;
}


/* =========================================================
   PROBABILIDADE DA PREVISÃO
========================================================= */

.probability-sub {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
  margin-bottom: 6px;
  line-height: 1.4;
}


/* =========================================================
   FORMULÁRIO
========================================================= */

label {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

input {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #e5e2dc;
  border-radius: 10px;
  font-size: 14px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: #3b5bdb;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.12);
}

input:hover {
  border-color: #d6d2cb;
}

#results-area {
  min-height: 220px;
}


/* =========================================================
   BOTÕES
========================================================= */

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.btn-primary {
  background: #3b5bdb;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: #2f4cc7;
  transform: translateY(-1px);
}

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

.btn-outline {
  background: transparent;
  border: 1px solid #e5e2dc;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-outline:hover {
  background: #f2ede6;
}


/* =========================================================
   BADGES DE STATUS
========================================================= */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 12px;
}

.badge-delayed {
  background: #dc2626;
  color: white;
}

.badge-ontime {
  background: #16a34a;
  color: white;
}


/* =========================================================
   BARRA DE PROBABILIDADE
========================================================= */

.progress-bar {
  background: #e5e2dc;
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  background: #3b5bdb;
  height: 100%;
  transition: width 200ms ease-in-out;
}


/* =========================================================
   EXPLICAÇÃO DO MODELO (SHAP)
========================================================= */

.factors-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 14px;
  line-height: 1.5;
  max-width: 95%;
}

.factor {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
}

.factor:first-of-type {
  margin-top: 10px;
}

.factor span:first-child {
  flex: 1;
  line-height: 1.5;
  color: #374151;
}

.factor span:last-child {
  white-space: nowrap;
  font-weight: 600;
}

.increase {
  color: #dc2626;
}

.decrease {
  color: #16a34a;
}

.model-decision {
  font-size: 14px;
  color: #374151;
  margin-top: 4px;
}

.model-confidence {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}


/* =========================================================
   ESTADO VAZIO DE RESULTADOS
========================================================= */

.results-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #e5e2dc;
  border-radius: 14px;
  padding: 32px;
  color: #8b8b8b;
  font-size: 14px;
}


/* =========================================================
   LOADER
========================================================= */

.loader {
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.hidden {
  display: none;
}

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


/* =========================================================
   SEÇÕES INSTITUCIONAIS
========================================================= */

#about,
#method,
#disclaimer {
  max-width: 720px;
  margin: 70px auto 0 auto;
  text-align: justify;
  hyphens: auto;
}

#about h2,
#method h2,
#disclaimer h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #6b7280;
}

#about p,
#method p,
#disclaimer p {
  margin-bottom: 14px;
  line-height: 1.7;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
  padding: 22px 0;
}

.footer-content {
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}


/* =========================================================
   RESPONSIVIDADE
========================================================= */

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

@media (max-width: 640px) {
  .button-group {
    flex-direction: column;
  }
}


/* =========================================================
   UTILITÁRIOS
========================================================= */

.w-0 { width: 0%; }
.w-10 { width: 10%; }
.w-20 { width: 20%; }
.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-80 { width: 80%; }
.w-90 { width: 90%; }
.w-100 { width: 100%; }