/* ============================================================
   Identidade Visual — Fretex
   Design moderno, premium e mobile-first.
   Paleta: Azul Marinho (confiança) + Laranja Coral (ação).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #002050;
  --primary-light: #0d3873;
  --primary-dark: #001230;
  --accent: #e85818;
  --accent-light: #ff763b;
  --accent-dark: #b83e0c;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1e293b;
  --text-dark: #0f172a;
  --muted: #64748b;
  --green: #10b981;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 32, 80, 0.05), 0 2px 8px rgba(0, 32, 80, 0.02);
  --shadow-hover: 0 20px 40px rgba(0, 32, 80, 0.09), 0 4px 12px rgba(0, 32, 80, 0.03);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cabeçalho ---------- */
.header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.01);
}

.header .wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header img {
  height: 45px;
  width: auto;
  display: block;
  object-fit: contain;
}

.header .brand-fallback {
  font-weight: 800;
  font-size: 22px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.header .tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--primary-light);
  font-weight: 600;
  background: rgba(13, 56, 115, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(circle at top right, rgba(232, 88, 24, 0.15), transparent), 
              linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #ffffff;
  padding: 50px 20px 65px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 10% 20%, rgba(0, 0, 0, 0.15) 0%, transparent 80%);
  pointer-events: none;
}

.hero .wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  opacity: 0.88;
  font-size: 15px;
  font-weight: 300;
  max-width: 480px;
}

/* ---------- Container / card ---------- */
.container {
  max-width: 540px;
  margin: -35px auto 0;
  padding: 0 16px 60px;
  position: relative;
  z-index: 2;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.card .sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Form ---------- */
label.field {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type=text], input[type=password] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-dark);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #ffffff;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 88, 24, 0.12);
}

.btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #ff6d2b);
  box-shadow: 0 5px 15px rgba(232, 88, 24, 0.3);
  transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
}

.btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 20px rgba(232, 88, 24, 0.4);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  filter: grayscale(0.4);
  box-shadow: none;
}

.btn-ghost {
  background: #f8fafc;
  color: var(--primary-light);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: none;
}

/* ---------- Resultado / débito ---------- */
.result {
  margin-top: 24px;
}

.debt {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #ffffff;
}

.debt-head {
  background: var(--primary);
  color: #ffffff;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.debt-head .nome {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
}

.badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.pend {
  background: #ffebe6;
  color: var(--accent-dark);
}

.badge.pago {
  background: #e6f7f0;
  color: var(--green);
}

.debt-body {
  padding: 20px;
  background: #ffffff;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14.5px;
}

.row:last-of-type {
  border-bottom: 0;
}

.row .k {
  color: var(--muted);
}

.row .v {
  font-weight: 600;
  text-align: right;
  color: var(--text-dark);
}

.valor-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-sm);
  text-align: center;
  background: linear-gradient(135deg, #fffaf5, #fff0e6);
  border: 1px solid #ffd4b8;
}

.valor-box .lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.valor-box .valor {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-dark);
  line-height: 1.1;
  margin-top: 4px;
  letter-spacing: -0.5px;
}

/* ---------- Pagamento / Pix ---------- */
.pay-area {
  margin-top: 20px;
}

.qr {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin: 14px 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

.qr img, .qr canvas {
  display: block;
  max-width: 100%;
}

.pix-area {
  margin-top: 18px;
  background: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.pix-area .pix {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
  margin: 10px 0;
  max-height: 100px;
  overflow-y: auto;
}

/* ---------- Pagamento Pix ---------- */
.pix-payment-page {
  margin-top: 54px;
  scroll-margin-top: 74px;
}

.pix-payment-heading {
  text-align: center;
  padding: 0 10px;
}

.pix-payment-heading h2 {
  margin: 0 0 3px;
  color: #11243d;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.pix-payment-heading p {
  margin: 0;
  color: #7a8493;
  font-size: 14px;
  line-height: 1.4;
}

.pix-bank-alert {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 24px 0 16px;
  padding: 15px 17px;
  border: 1px solid #afd7b9;
  border-radius: 8px;
  background: #e7f4e9;
  color: #173a2b;
}

.pix-bank-alert svg {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 1px;
  fill: none;
  stroke: #11953b;
  stroke-width: 2;
  stroke-linecap: round;
}

.pix-bank-alert p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.pix-checkout-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.pix-deadline-row {
  min-height: 62px;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #e5e7eb;
  color: #121826;
  font-size: 14px;
  font-weight: 600;
}

.pix-countdown {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ef5362;
}

.pix-countdown span {
  width: 25px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #ef5362;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pix-countdown b {
  margin: 0 2px;
  font-size: 18px;
}

.pix-order-summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid #e5e7eb;
}

.pix-order-summary > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pix-order-summary span {
  color: #87909d;
  font-size: 12px;
  line-height: 1.3;
}

.pix-order-summary strong {
  color: #11243d;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 800;
}

.pix-product-summary {
  text-align: right;
}

.pix-product-summary strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  text-transform: uppercase;
}

.pix-result-panel {
  padding: 18px 52px 22px;
  text-align: center;
}

.pix-loading {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #667085;
  font-size: 14px;
}

.pix-loading span {
  width: 28px;
  height: 28px;
  border: 3px solid #dbeafe;
  border-top-color: #0878e5;
  border-radius: 50%;
  animation: pix-spin 0.75s linear infinite;
}

.pix-loading p,
.pix-error p {
  margin: 0;
}

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

.pix-error {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #b42318;
  font-size: 14px;
}

.pix-error button {
  padding: 10px 18px;
  border: 0;
  border-radius: 7px;
  background: #0878e5;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pix-qr-wrap {
  position: relative;
  width: 196px;
  min-height: 196px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.12);
}

.pix-qr-code,
.pix-qr-image {
  width: 176px;
  height: 176px;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
}

.pix-qr-code img,
.pix-qr-code canvas {
  width: 176px !important;
  height: 176px !important;
  display: block;
}

.pix-qr-wrap > span {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  padding: 4px 11px;
  border: 1px solid #d8dde5;
  border-radius: 999px;
  background: #ffffff;
  color: #667085;
  font-size: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.pix-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 26px 0 22px;
}

.pix-trust-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: #818895;
  font-size: 11px;
  line-height: 1.25;
}

.pix-trust-grid svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #2ec48d;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pix-copy-button,
.pix-confirm-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.pix-copy-button {
  background: #0878e5;
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(8, 120, 229, 0.24);
}

.pix-copy-button:hover {
  background: #0568ca;
}

.pix-copy-button.copied {
  background: #0f9f70;
}

.pix-confirm-button {
  min-height: 42px;
  margin-top: 11px;
  background: #e5f2ff;
  color: #0878e5;
}

.pix-confirm-button:hover {
  background: #d7ebff;
}

.pix-copy-button:active,
.pix-confirm-button:active {
  transform: translateY(1px);
}

.pix-copy-button:disabled,
.pix-confirm-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.pix-copy-button svg,
.pix-confirm-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pix-confirm-note {
  margin: 17px auto 0;
  max-width: 310px;
  color: #7b8491;
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .pix-payment-page {
    margin-top: 50px;
    margin-left: -4px;
    margin-right: -4px;
  }

  .pix-payment-heading h2 {
    font-size: 17px;
  }

  .pix-bank-alert {
    margin-top: 20px;
    padding: 13px 14px;
  }

  .pix-deadline-row,
  .pix-order-summary {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pix-result-panel {
    padding: 18px 18px 22px;
  }

  .pix-countdown {
    gap: 4px;
  }

  .pix-countdown span {
    width: 23px;
    height: 31px;
  }
}

.msg {
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* ---------- Confiança / rodapé ---------- */
.trust {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.trust svg {
  width: 15px;
  height: 15px;
  fill: var(--green);
  flex: none;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 16px 30px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
}

.footer-logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-info {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto;
}



/* ---------- Novo Fluxo de Rastreamento ---------- */

.tracking-result-top-space {
  height: 48px;
}

.tracking-result-title {
  margin: 0;
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}

/* Stepper Progress */
.stepper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 20px 0 28px;
  position: relative;
  padding: 0 10px;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: var(--line);
  z-index: 1;
}

.stepper-progress {
  position: absolute;
  top: 14px;
  left: 30px;
  width: 50%; /* 50% significa até a etapa 2 */
  height: 3px;
  background: var(--green);
  z-index: 2;
  transition: width 0.4s ease;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 3;
  flex: 1;
}

.step-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 3px solid var(--card);
  transition: all 0.3s ease;
}

.step.active .step-icon {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 88, 24, 0.15);
}

.step.completed .step-icon {
  background: var(--green);
}

.step-label {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.step.active .step-label {
  color: var(--accent-dark);
}

.step.completed .step-label {
  color: var(--text-dark);
}

.step-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Alertas Customizados */
.alert-box {
  background: #fff8f5;
  border: 1.5px solid #ffdec9;
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}

.alert-box.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15.5px;
  color: #c2410c;
  margin-bottom: 8px;
}

.alert-box.success .alert-title {
  color: #15803d;
}

.alert-title svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

.alert-text {
  font-size: 13.5px;
  color: #7c2d12;
  line-height: 1.5;
  margin-bottom: 0;
}

.alert-box.success .alert-text {
  color: #166534;
}

.alert-text.has-action {
  margin-bottom: 16px;
}

/* Informações / Ficha técnica */
.info-section {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
  text-align: left;
}

.info-title {
  font-size: 16px;
  font-weight: 700;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dark);
  background: #f8fafc;
}

.info-body {
  padding: 10px 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-key {
  color: var(--muted);
}

.info-val {
  font-weight: 600;
  color: var(--text-dark);
}

/* Timeline Vertical Detalhada */
.vertical-timeline {
  position: relative;
  padding-left: 24px;
  margin: 16px 0;
  text-align: left;
}

.vertical-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--line);
  border: 3px solid var(--card);
  z-index: 2;
}

.timeline-dot.completed {
  background: var(--green);
}

.timeline-dot.alert {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 88, 24, 0.15);
}

.timeline-content {
  font-size: 13.5px;
}

.timeline-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.timeline-title {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.timeline-desc {
  color: var(--muted);
}

/* Layout de Formulário em Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-top: 14px;
  text-align: left;
}

.form-col-6 { grid-column: span 6; }
.form-col-4 { grid-column: span 4; }
.form-col-3 { grid-column: span 3; }
.form-col-2 { grid-column: span 2; }

.select-field {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-dark);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  outline: none;
  background: #ffffff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.select-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 88, 24, 0.12);
}


/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .hero {
    padding: 35px 18px 55px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero p {
    font-size: 14px;
  }
  .container {
    margin-top: -30px;
    padding: 0 12px 48px;
  }
  .card {
    padding: 22px;
    border-radius: var(--radius-sm);
  }
  .header .tag {
    display: none;
  }
  .valor-box .valor {
    font-size: 32px;
  }
}
