/* ============================================================
   VARIÁVEIS GLOBAIS
   ============================================================ */
:root {
  --bg-1: #07111f;
  --bg-2: #0b1e38;
  --panel: rgba(8, 20, 39, 0.78);
  --panel-border: rgba(136, 180, 255, 0.16);
  --text: #f4f8ff;
  --muted: #9eb0cb;
  --primary-1: #2a7fff;
  --primary-2: #42c7ff;
  --success: #16c784;
  --warning: #ffb547;
  --danger: #ff6b6b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

/* ============================================================
   RESET E BASE
   ============================================================ */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(42, 127, 255, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(66, 199, 255, 0.12), transparent 28%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

body {
  position: relative;
  overflow-x: hidden;
}

/* ============================================================
   EFEITOS DE FUNDO (GLOW)
   ============================================================ */
.bg-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  top: -120px;
  left: -120px;
  background: #2a7fff;
}

.glow-2 {
  right: -80px;
  bottom: -120px;
  background: #00cfff;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

/* ============================================================
   TELAS (SCREENS)
   ============================================================ */
.screen {
  display: none;
  width: 100%;
}

.screen.active {
  display: grid;
  gap: 28px;
}

#loginScreen.active {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}

#trackingScreen.active {
  display: grid;
  gap: 24px;
  align-content: start;
  width: 100%;
}

/* ============================================================
   HERO (SEÇÃO ESQUERDA DO LOGIN)
   ============================================================ */
.hero h1 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  max-width: 680px;
}

.hero p {
  margin-top: 18px;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

/* ============================================================
   TIPOGRAFIA DE SUPORTE
   ============================================================ */
.eyebrow,
.panel-kicker {
  display: inline-block;
  color: #9dd9ff;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ============================================================
   PAINEL (CARD GENÉRICO)
   ============================================================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
}

.login-panel,
.search-panel,
.result-card {
  padding: 28px;
}

.panel-header,
.result-top,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header h2,
.result-top h2 {
  margin: 6px 0 0;
  font-size: 1.45rem;
}

.panel-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(42, 127, 255, 0.22), rgba(66, 199, 255, 0.12));
  border: 1px solid rgba(153, 210, 255, 0.14);
}

/* ============================================================
   FORMULÁRIO
   ============================================================ */
.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.label,
.small-label {
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(153, 210, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border-radius: 14px;
  padding: 0 16px;
  outline: none;
  font-size: 0.98rem;
  transition: 0.2s ease;
  font-family: inherit;
}

input {
  height: 54px;
}

textarea {
  min-height: 140px;
  resize: vertical;
  padding: 16px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #7e92b2;
}

input:focus,
textarea:focus {
  border-color: rgba(66, 199, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(66, 199, 255, 0.08);
}

/* ============================================================
   BOTÕES
   ============================================================ */
.primary-btn,
.ghost-btn,
.secondary-btn {
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
  padding: 0 18px;
}

.primary-btn {
  color: white;
  background: linear-gradient(90deg, var(--primary-1), var(--primary-2));
  box-shadow: 0 16px 34px rgba(42, 127, 255, 0.28);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(153, 210, 255, 0.14);
}

.secondary-btn {
  color: #081426;
  background: #d9ecff;
}

.primary-btn:hover,
.ghost-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

/* ============================================================
   CAMPO DE SENHA
   ============================================================ */
.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 56px;
}

.eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(153, 210, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
}

/* ============================================================
   TOPBAR (CABEÇALHO DA TELA DE RASTREIO)
   ============================================================ */
.topbar {
  padding: 8px 0 4px;
}

.topbar h1 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-top: 6px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   AÇÕES DE RASTREAMENTO
   ============================================================ */
.tracking-actions {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.tracking-actions .primary-btn {
  min-width: 170px;
}

.tracking-actions .ghost-btn {
  min-width: 150px;
}

.helper-text {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.hidden {
  display: none !important;
}

/* ============================================================
   RESULTADOS
   ============================================================ */
.results-stack {
  display: grid;
  gap: 18px;
}

.status-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(22, 199, 132, 0.14);
  border: 1px solid rgba(22, 199, 132, 0.28);
  color: #8ff0c4;
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.info-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(153, 210, 255, 0.1);
  display: grid;
  gap: 8px;
}

.info-item strong {
  font-size: 1.04rem;
  line-height: 1.4;
}

/* ============================================================
   CAIXA DE ALERTA
   ============================================================ */
.alert-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 181, 71, 0.08);
  border: 1px solid rgba(255, 181, 71, 0.18);
  color: #ffd390;
  font-size: 0.92rem;
  display: none;
}

.alert-box.show {
  display: block;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 980px) {
  #loginScreen.active {
    grid-template-columns: 1fr;
  }

  .hero {
    order: 1;
  }

  .login-panel {
    order: 2;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 100%);
    padding: 24px 0;
  }

  .login-panel,
  .search-panel,
  .result-card {
    padding: 20px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-header,
  .result-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .tracking-actions {
    width: 100%;
  }

  .ghost-btn,
  .primary-btn,
  .secondary-btn {
    width: 100%;
  }
}
