/* ESTILOS DA PÁGINA */
/* consulta.html — busca por protocolo e linha do tempo
   Complementa css/base.css (não repete o que já está lá). */

/* HEADER */

/* MAIN */

main {
  width: min(760px, 92%);
  margin: 0 auto;
  flex: 1;
  padding: clamp(28px, 4vw, 52px) 0 clamp(40px, 5vw, 60px);
}

.page-label {
  font-size: clamp(11px, 1vw, 12px);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 8px;
  text-align: center;
}

.page-title {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0 0 10px;
  line-height: 1.15;
  text-align: center;
}

.page-subtitle {
  color: var(--muted);
  font-size: clamp(13.5px, 1.2vw, 15px);
  margin: 0 auto clamp(24px, 3vw, 32px);
  line-height: 1.55;
  text-align: center;
  max-width: 520px;
}

/* SEARCH CARD */

.search-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow-lg);
  margin-bottom: clamp(20px, 2.6vw, 28px);
}

.search-card .icon-top {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--orange);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}

.search-card .icon-top i {
  width: 26px;
  height: 26px;
}

.search-card h2 {
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 800;
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: -0.3px;
}

.search-card p.hint {
  color: var(--muted);
  font-size: clamp(12.5px, 1.05vw, 13.5px);
  margin: 0 0 22px;
  text-align: center;
  line-height: 1.5;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: clamp(12.5px, 1vw, 13.5px);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.protocol-input-wrap {
  position: relative;
}

.protocol-input-wrap input {
  width: 100%;
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  padding: 15px 18px 15px 48px;
  outline: none;
  font: inherit;
  font-size: clamp(15px, 1.3vw, 17px);
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--input-bg);
  color: var(--text);
  font-family: monospace;
  text-transform: uppercase;
  transition:
    border 0.15s,
    box-shadow 0.15s;
}

.protocol-input-wrap input::placeholder {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  opacity: 0.7;
  font-family: inherit;
}

.protocol-input-wrap input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

.protocol-input-wrap .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.15s;
}

.protocol-input-wrap input:focus ~ .input-icon,
.protocol-input-wrap input:not(:placeholder-shown) ~ .input-icon {
  color: var(--orange);
}

.field.error input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.field-error-msg {
  display: none;
  font-size: clamp(11.5px, 0.95vw, 12.5px);
  color: var(--danger);
  font-weight: 600;
  margin-top: 6px;
}

.field.error .field-error-msg {
  display: block;
}

.search-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.search-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 13px 20px;
  font-size: clamp(14px, 1.1vw, 15px);
  border-radius: 10px;
  min-width: 140px;
}

/* INFO BANNER */

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--info-soft);
  border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
  margin-top: 18px;
  font-size: clamp(12.5px, 1.05vw, 13.5px);
  line-height: 1.55;
  color: var(--text);
}

.info-banner i {
  width: 18px;
  height: 18px;
  color: var(--info);
  flex: none;
  margin-top: 2px;
}

.info-banner strong {
  color: var(--text);
  font-weight: 800;
}

.info-banner a {
  color: var(--info);
  font-weight: 700;
  text-decoration: none;
}

.info-banner a:hover {
  text-decoration: underline;
}

/* RESULT */

.result {
  display: none;
}

.result.visible {
  display: block;
  animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.result-head {
  padding: clamp(20px, 2.6vw, 28px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.result-head-left {
  min-width: 0;
}

.result-protocol {
  font-family: monospace;
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 0.5px;
  margin: 0 0 6px;
  word-break: break-all;
}

.result-date {
  color: var(--muted);
  font-size: clamp(12px, 1vw, 13px);
  font-weight: 600;
}

.result-status-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: clamp(12px, 1vw, 13px);
  font-weight: 700;
  white-space: nowrap;
}

.badge i {
  width: 13px;
  height: 13px;
}

.result-body {
  padding: clamp(20px, 2.6vw, 28px);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.info-item {
  padding: 14px 16px;
  background: var(--card-soft);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}

.info-item .label {
  font-size: clamp(10.5px, 0.9vw, 11.5px);
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.info-item .value {
  font-size: clamp(13px, 1.05vw, 14px);
  font-weight: 600;
  word-break: break-word;
  line-height: 1.45;
}

.section-title {
  font-size: clamp(13px, 1.1vw, 14px);
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  width: 15px;
  height: 15px;
  color: var(--orange);
}

/* TIMELINE */

.timeline {
  padding-left: 6px;
}

.tl-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  position: relative;
  padding-bottom: 18px;
}

.tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 22px;
  bottom: 0;
  width: 1.5px;
  background: var(--border);
}

.tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--orange);
  border: 3px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--orange);
  margin-top: 4px;
  flex: none;
  z-index: 1;
}

.tl-dot.done {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.tl-dot.pending {
  background: var(--border);
  box-shadow: 0 0 0 1px var(--border);
}

.tl-content .tl-status {
  font-size: clamp(13px, 1.1vw, 14px);
  font-weight: 800;
  margin: 0 0 3px;
  letter-spacing: -0.2px;
}

.tl-content .tl-date {
  font-size: clamp(11.5px, 0.95vw, 12.5px);
  color: var(--muted);
  font-weight: 600;
}

.tl-content .tl-note {
  font-size: clamp(12.5px, 1.05vw, 13.5px);
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.55;
  padding: 10px 12px;
  background: var(--card-soft);
  border-radius: 8px;
  border-left: 3px solid var(--orange);
}

/* NOT FOUND */

.not-found {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(32px, 5vw, 48px) 24px;
  text-align: center;
  box-shadow: var(--shadow);
  display: none;
}

.not-found.visible {
  display: block;
  animation: fadeUp 0.35s ease;
}

.nf-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

.nf-icon i {
  width: 30px;
  height: 30px;
}

.not-found h3 {
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 800;
  margin: 0 0 8px;
}

.not-found p {
  color: var(--muted);
  margin: 0 auto;
  font-size: clamp(13px, 1.05vw, 14px);
  line-height: 1.6;
  max-width: 420px;
}

.not-found .hint-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 16px;
  background: var(--card-soft);
  border-radius: 10px;
  font-size: clamp(12px, 1vw, 13px);
  color: var(--muted);
  border: 1px solid var(--border-soft);
}

.not-found .hint-box i {
  width: 14px;
  height: 14px;
  color: var(--orange);
}

/* RATE LIMIT */

.rate-warning {
  display: none;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  font-size: clamp(12px, 1vw, 13px);
  color: var(--text);
  line-height: 1.5;
  align-items: flex-start;
  gap: 10px;
}

.rate-warning.visible {
  display: flex;
}

.rate-warning i {
  width: 16px;
  height: 16px;
  color: var(--warning);
  flex: none;
  margin-top: 2px;
}

/* HELP BOX */

.help-card {
  background: var(--card-soft);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: clamp(18px, 2.4vw, 24px);
  margin-top: clamp(20px, 2.6vw, 28px);
}

.help-card h3 {
  font-size: clamp(14px, 1.2vw, 15.5px);
  font-weight: 800;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-card h3 i {
  width: 16px;
  height: 16px;
  color: var(--orange);
}

.help-card ul {
  margin: 0;
  padding: 0 0 0 20px;
  color: var(--muted);
  font-size: clamp(12.5px, 1.05vw, 13.5px);
  line-height: 1.75;
}

.help-card ul li {
  margin-bottom: 6px;
}

.help-card ul li:last-child {
  margin-bottom: 0;
}

.help-card strong {
  color: var(--text);
  font-weight: 700;
}

.help-card a {
  color: var(--orange);
  font-weight: 700;
  text-decoration: none;
}

.help-card a:hover {
  text-decoration: underline;
}

/* FOOTER */

@media (max-width: 800px) {
  header {
    padding: 12px 4%;
  }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 18px 5%;
    gap: 10px;
    z-index: 15;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  }
  nav.open {
    display: flex;
  }
  nav a,
  nav button,
  nav .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 12px 16px;
  }
  .theme-toggle {
    width: 42px;
    height: 42px;
    margin: 6px auto 0;
  }
  .menu-btn {
    display: grid;
    place-items: center;
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  main {
    width: 94%;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .result-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .result-status-wrap {
    align-items: flex-start;
  }
  .search-actions {
    flex-direction: column;
  }
  .search-actions .btn {
    width: 100%;
  }
}
