/* ================================================================
   Jadlog — Sistema de Reagendamento
   Design baseado na identidade visual real da Jadlog
   ================================================================ */

:root {
  --red:        #C8102E;
  --red-dark:   #A50D25;
  --red-light:  rgba(200,16,46,.08);
  --dark:       #1a1a1a;
  --mid:        #555;
  --soft:       #888;
  --border:     #e0e0e0;
  --border-mid: #ccc;
  --bg:         #f5f5f5;
  --white:      #fff;
  --ok:         #1a7f45;
  --ok-light:   rgba(26,127,69,.08);
  --warn-bg:    #fff8e1;
  --warn-border:#f0c040;
}

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

html, body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--white);
  color: var(--dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── header ── */
.header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
}
.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header img { height: 42px; }
.header-tagline {
  font-size: 12px;
  color: var(--soft);
  margin-left: 14px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
  line-height: 1.3;
}

/* ── containers ── */
.container       { max-width: 680px; margin: 0 auto; padding: 36px 20px 80px; }
.container-wide  { max-width: 960px; margin: 0 auto; padding: 36px 20px 80px; }

/* ── search banner (index.php) ── */
.search-hero {
  background: var(--red);
  padding: 40px 24px 48px;
}
.search-hero-inner {
  max-width: 680px;
  margin: 0 auto;
}
.search-hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin-bottom: 6px;
}
.search-hero h1 {
  color: var(--white);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.2;
}
.search-row {
  display: flex;
  gap: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.search-row input {
  flex: 1;
  padding: 16px 20px;
  font-size: 16px;
  border: none;
  outline: none;
  color: var(--dark);
  background: var(--white);
}
.search-row input::placeholder { color: #aaa; }
.search-row button {
  padding: 16px 32px;
  background: var(--dark);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.search-row button:hover { background: #333; }
.search-row button:disabled { background: #666; cursor: not-allowed; }
.search-security {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.65);
}
.search-erro { display: none; }

/* ── toast de erro ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #222;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: calc(100vw - 40px);
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-icon { color: #ff6b6b; flex-shrink: 0; }

/* ── section wrapper ── */
.section {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}
.section:first-child { padding-top: 32px; }
.section:last-child  { border-bottom: none; }
.section-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
}

/* ── aviso de tentativa ── */
.aviso-tentativa {
  background: var(--warn-bg);
  border-left: 4px solid var(--red);
  padding: 16px 20px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 0;
}
.aviso-tentativa strong { color: var(--red); display: block; font-size: 15px; margin-bottom: 3px; }
.aviso-tentativa p { font-size: 14px; color: var(--mid); }

/* ── timeline vertical (estilo Jadlog) ── */
.timeline-v { padding: 4px 0; }

.tv-item {
  display: flex;
  gap: 20px;
  position: relative;
}
.tv-item:not(:last-child) { padding-bottom: 32px; }

/* linha conectora */
.tv-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 29px;
  top: 60px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tv-item.done:not(:last-child)::after  { background: var(--red); }
.tv-item.active:not(:last-child)::after { background: var(--border); }

/* círculo do ícone */
.tv-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.tv-item.done   .tv-icon { background: var(--red); }
.tv-item.active .tv-icon { background: var(--red); box-shadow: 0 0 0 5px rgba(200,16,46,.15); }
.tv-item.pending .tv-icon { background: #d0d0d0; }

.tv-icon svg {
  width: 28px;
  height: 28px;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* texto da timeline */
.tv-body { padding-top: 12px; }
.tv-status {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
}
.tv-item.pending .tv-status { color: #bbb; }
.tv-date {
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
  margin-top: 3px;
}
.tv-item.pending .tv-date { color: #ccc; }
.tv-item.active .tv-status { color: var(--red); }

/* ── grade de informações do pedido ── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}
.info-grid .full { grid-column: 1 / -1; }
.info-grid .lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--soft);
  margin-bottom: 3px;
}
.info-grid .val {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.4;
}

/* ── lista de itens ── */
.itens-lista { list-style: none; }
.itens-lista li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--mid);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}
.itens-lista li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  margin-top: 6px;
}
.itens-lista li:last-child { border-bottom: none; }

/* ── total ── */
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 2px solid var(--border);
  margin-top: 8px;
}
.total-row .lbl { font-size: 13px; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.total-row .val { font-size: 24px; font-weight: 800; color: var(--dark); }

/* ── badge transportadora ── */
.carrier { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.carrier-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.rastreio { font-family: monospace; font-size: 13px; background: var(--bg); padding: 3px 8px; border-radius: 3px; border: 1px solid var(--border); display: inline-block; margin-top: 4px; }

/* ── botão principal ── */
.btn-cta {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--red);
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-cta:hover { background: var(--red-dark); }
.btn-cta:disabled { background: #bbb; cursor: not-allowed; }
.btn-cta.outline {
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
}
.btn-cta.outline:hover { background: var(--red-light); }
.btn-cta.gray {
  background: var(--bg);
  color: var(--mid);
  border: 1px solid var(--border);
}
.btn-cta.gray:hover { background: var(--border); }

/* ── link ghost ── */
.btn-ghost {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  display: block;
  text-align: center;
  width: 100%;
}

/* ── formulário ── */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--soft);
  margin-bottom: 6px;
}
.field input[type=text],
.field input[type=password] {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  outline: none;
  transition: border .15s;
  background: var(--white);
  color: var(--dark);
}
.field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.1); }
.field-erro { font-size: 13px; color: var(--red); margin-top: 8px; display: none; }
.field-hint { font-size: 12px; color: var(--soft); margin-top: 6px; }

/* ── stepper ── */
.stepper {
  display: flex;
  align-items: flex-start;
  margin-bottom: 28px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 64px;
}
.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #d0d0d0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step.done .step-circle,
.step.active .step-circle {
  background: var(--red);
  border-color: var(--red);
}
.step-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 8px;
  color: #b0b0b0;
  text-align: center;
}
.step.done .step-label,
.step.active .step-label { color: var(--red); }
.step-bar {
  flex: 1;
  height: 4px;
  background: #d0d0d0;
  margin-top: 13px;
}
.step-bar.done { background: var(--red); }

/* ── calendário ── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-nav b { font-size: 15px; }
.cal-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--red);
  background: white;
  color: var(--red);
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-btn:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; text-align: center; }
.cal-wd { font-size: 11px; font-weight: 700; color: var(--soft); padding: 6px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
}
.cal-day.off  { color: #ccc; cursor: default; }
.cal-day.pick:hover { background: var(--bg); }
.cal-day.sel,
.cal-day.sel:hover { background: var(--red) !important; color: #fff !important; border-color: var(--red); font-weight: 700; }
.cal-legenda  { font-size: 12px; color: var(--soft); margin-top: 10px; }

/* ── períodos ── */
.periodos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.per {
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: border-color .15s;
}
.per:hover { border-color: var(--border-mid); }
.per.sel { border-color: var(--red); background: var(--red-light); }
.per-ico { font-size: 24px; }
.per-title { font-weight: 700; font-size: 14px; display: block; }
.per-sub { font-size: 12px; color: var(--soft); }

/* ── confirmação ── */
.check-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--ok-light);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 20px;
}
.resumo { background: var(--bg); border-radius: 4px; overflow: hidden; }
.resumo-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 16px;
}
.resumo-row:last-child { border-bottom: none; }
.resumo-row .k { color: var(--soft); font-size: 12px; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.resumo-row .v { font-weight: 600; text-align: right; }

/* ── modal de busca por CPF ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white;
  border-radius: 6px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  transform: translateY(24px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { font-size: 14px; color: var(--soft); margin-bottom: 22px; }

/* ── token inválido ── */
.not-found {
  text-align: center;
  padding: 48px 24px;
  max-width: 440px;
  margin: 0 auto;
}
.not-found-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .4;
}
.not-found h2 { font-size: 22px; margin-bottom: 8px; }
.not-found p { color: var(--soft); font-size: 14px; margin-bottom: 24px; }

/* ── upload (manifesto) ── */
.upload-zone {
  border: 2px dashed var(--border-mid);
  border-radius: 6px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--red); background: var(--red-light); }
.upload-zone input { display: none; }
.upload-ico { font-size: 40px; margin-bottom: 12px; }
.upload-zone h3 { font-size: 16px; margin-bottom: 4px; }
.upload-zone p { font-size: 13px; color: var(--soft); }
.badge { display: inline-block; padding: 3px 8px; border-radius: 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.badge-ok { background: var(--ok-light); color: var(--ok); }
.badge-red { background: var(--red-light); color: var(--red); }
.table-wrap { overflow-x: auto; border-radius: 4px; border: 1px solid var(--border); }
.preview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.preview-table th { background: var(--bg); padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); border-bottom: 2px solid var(--border); white-space: nowrap; }
.preview-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.preview-table tr:last-child td { border-bottom: none; }

/* ── login admin ── */
/* ── abas admin ── */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  padding: 0 20px;
}
.admin-tab {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--dark); }
.admin-tab.active { color: var(--red); border-bottom-color: var(--red); }

.login-box {
  max-width: 380px;
  margin: 60px auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px 32px;
}
.login-box h2 { font-size: 20px; margin-bottom: 4px; }
.login-box p { font-size: 14px; color: var(--soft); margin-bottom: 24px; }

/* ── footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--soft);
  margin-top: 40px;
}

/* ── ícones de "como funciona" (index) ── */
.how-steps { display: flex; flex-direction: column; gap: 20px; }
.how-step  { display: flex; align-items: center; gap: 16px; }
.how-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--red-light);
  border: 1px solid rgba(200,16,46,.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
}
.how-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 3px; }
.how-text span   { font-size: 13px; color: var(--soft); }

/* ── upgrade cards ── */
.upgrade-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upgrade-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  background: #fff;
}
.upgrade-card-destaque { border-color: var(--red); background: #fff8f8; }
.upgrade-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.upgrade-info { width: 100%; }
.upgrade-info strong { display: block; font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.upgrade-info span   { font-size: 12px; color: var(--soft); }
.upgrade-price { font-size: 16px; font-weight: 800; color: var(--red); }
.upgrade-btn {
  background: var(--red);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 0;
  border-radius: 6px;
  white-space: nowrap;
  width: 100%;
  text-align: center;
  display: block;
}

/* ── pix ── */
.pix-box { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.pix-header {
  background: #32bcad;
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 16px;
}
.pix-body { padding: 24px 20px; }
.pix-qr {
  display: block;
  margin: 0 auto 20px;
  width: 180px;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  background: white;
}
.pix-valor { text-align: center; font-size: 28px; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.pix-desc  { text-align: center; font-size: 13px; color: var(--soft); margin-bottom: 20px; }
.pix-copia {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--mid);
  margin-bottom: 12px;
  user-select: all;
}
.btn-copiar {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid #32bcad;
  border-radius: 4px;
  color: #32bcad;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  margin-bottom: 20px;
}
.btn-copiar:hover  { background: rgba(50,188,173,.08); }
.btn-copiar.copiado { background: rgba(50,188,173,.12); }
.pix-timer { text-align: center; font-size: 13px; color: var(--soft); margin-bottom: 20px; }
.pix-timer strong { color: var(--dark); font-size: 18px; display: block; }
.pix-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.pix-info-row:last-child { border-bottom: none; }
.pix-info-row .k { color: var(--soft); }
.ico-pix svg { width: 28px; height: 28px; fill: white; }

/* ── ícone de token não encontrado ── */
.not-found-icon {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  color: var(--soft);
}

/* ── ícone de período (sol / relógio) ── */
.per-ico {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--mid);
  transition: background .15s, color .15s;
}
.per.sel .per-ico { background: var(--red-light); color: var(--red); border-color: rgba(200,16,46,.2); }

/* ── ícone de upload ── */
.upload-ico {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--soft);
}
.upload-zone:hover .upload-ico,
.upload-zone.drag  .upload-ico { background: rgba(200,16,46,.12); color: var(--red); }

/* ── utilitários ── */
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.center { text-align: center; }
.text-red { color: var(--red); }

@media (max-width: 520px) {
  .search-hero { padding: 28px 16px 36px; }
  .search-row { flex-direction: column; border-radius: 4px; }
  .search-row button { padding: 14px; border-radius: 0 0 4px 4px; }
  .info-grid, .periodos { grid-template-columns: 1fr; }
  .step-label { display: none; }
  .header-tagline { display: none; }
}
