:root {
  --ink: #07131c;
  --ink-2: #1c3344;
  --fog: #d7e4ee;
  --paper: #f4f8fb;
  --sea: #1277a8;
  --sea-deep: #0b4f72;
  --signal: #ff8a3d;
  --signal-ink: #4a2200;
  --ok: #1f7a4d;
  --danger: #c0352b;
  --line: rgba(7, 19, 28, 0.12);
  --display: "Newsreader", Georgia, serif;
  --sans: "Archivo", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, rgba(7, 19, 28, 0.04), transparent 28%),
    linear-gradient(125deg, #0c2433 0%, #134861 38%, #1d6f8a 62%, #f2c49a 100%);
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  animation: floaty 16s ease-in-out infinite alternate;
}

.orb-1 {
  width: 46vw;
  height: 46vw;
  top: -12vw;
  right: -10vw;
  background: rgba(255, 138, 61, 0.35);
}

.orb-2 {
  width: 38vw;
  height: 38vw;
  bottom: 8%;
  left: -12vw;
  background: rgba(18, 119, 168, 0.4);
  animation-delay: -5s;
}

.lane {
  position: absolute;
  inset: 18% -10% auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: rotate(-8deg);
  animation: sweep 7s ease-in-out infinite;
}

.nav,
main,
.footer {
  position: relative;
  z-index: 1;
}

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #f7fbff;
}

.logo-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  display: grid;
  place-items: center;
  background: var(--signal);
  color: #fff;
  font-weight: 800;
}

.logo-word {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.12rem;
}

.nav-chip {
  color: rgba(247, 251, 255, 0.78);
  font-size: 0.82rem;
}

.nav-chip-link {
  text-decoration: none;
  border: 1px solid rgba(247, 251, 255, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.nav-chip-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.page-pedido .pedido-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2rem;
}

.pedido-error {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  background: rgba(244, 248, 251, 0.94);
  color: var(--danger);
  font-weight: 600;
}

.page-pedido .result {
  display: block;
}

.page-pedido .result-banner h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.pedido-sheet {
  display: grid;
  gap: 0.85rem;
  animation: lift 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pedido-sheet[hidden] {
  display: none !important;
}

.encomenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.3rem;
  border-radius: 22px;
  background: rgba(244, 248, 251, 0.96);
}

.encomenda-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  color: #c45a12;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 138, 61, 0.16);
  color: #c45a12;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.status-badge.ok {
  background: rgba(31, 122, 77, 0.14);
  color: #1f7a4d;
}

.status-badge.warn {
  background: #ffe8d4;
  color: #d46312;
}

.stepper {
  list-style: none;
  margin: 0;
  padding: 1.2rem 1.1rem 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  border-radius: 22px;
  background: rgba(244, 248, 251, 0.96);
}

.stepper.stepper-fail {
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

.stepper-line.alert {
  background: #ff8a3d;
}

.stepper-item {
  min-width: 0;
}

.stepper-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.stepper-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 800;
  background: #d9e3ea;
  color: #5b7180;
}

.stepper-item.done .stepper-mark {
  background: #22a06b;
  color: #fff;
}

.stepper-item.shipped .stepper-mark {
  background: #ff8a3d;
  color: #fff;
  box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.18);
}

.stepper-item.alert .stepper-mark {
  background: #ff8a3d;
  color: #fff;
  box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.18);
}

.stepper-item.current .stepper-mark {
  background: #1277a8;
  color: #fff;
}

.stepper-line {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: #d5dee6;
}

.stepper-line.filled {
  background: #22a06b;
}

.stepper-line.shipped {
  background: #ff8a3d;
}

.stepper-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.stepper-meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.fail-card {
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 138, 61, 0.35);
  background: linear-gradient(165deg, #3a2418 0%, #2a1810 55%, #24140e 100%);
  display: grid;
  gap: 1rem;
  box-shadow: 0 12px 28px rgba(20, 8, 0, 0.28);
}

/* display:grid above must not override the hidden attribute */
.fail-card[hidden],
.fail-card:not(.is-visible) {
  display: none !important;
}

.fail-card.is-visible {
  display: grid !important;
}

.fail-card-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.fail-icon {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ff8a3d;
  color: #fff;
  font-weight: 800;
  margin-top: 0.15rem;
}

.fail-card h2 {
  margin: 0 0 0.4rem;
  color: #ff8a3d;
  font-size: 1.02rem;
  line-height: 1.35;
}

.fail-card p {
  margin: 0;
  color: #f0c4a0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.fail-cta {
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  background: linear-gradient(135deg, #ff8a3d, #ff6a14);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 320px;
  text-decoration: none;
  transition: transform 150ms ease, filter 150ms ease;
}

.fail-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.fail-cta .pin {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50% 50% 50% 0;
  background: #ffb4d3;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 3px rgba(255, 180, 211, 0.35);
}

.address-panel h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.35rem;
}

.hero {
  max-width: 640px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem 2.6rem;
  min-height: calc(100svh - 5.5rem);
  display: grid;
  align-content: center;
  gap: 1.35rem;
}

.hero-copy {
  animation: lift 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: rgba(247, 251, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1.85rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #f7fbff;
  animation: lift 780ms 60ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.tagline {
  margin: 0.55rem 0 0;
  max-width: 42ch;
  color: rgba(247, 251, 255, 0.84);
  font-size: 0.98rem;
  line-height: 1.55;
  font-weight: 500;
}

.hero-tracker {
  width: 100%;
  padding: 1.2rem 1.25rem 1.25rem;
  border-radius: 18px;
  background:
    linear-gradient(165deg, rgba(244, 248, 251, 0.97), rgba(223, 234, 242, 0.94));
  box-shadow: 0 18px 48px rgba(4, 14, 22, 0.28);
  animation: lift 820ms 100ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.tracker label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.tracker-row {
  display: flex;
  gap: 0.65rem;
}

#query-input,
#new-address {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

#query-input:focus,
#new-address:focus {
  border-color: rgba(18, 119, 168, 0.55);
  box-shadow: 0 0 0 4px rgba(18, 119, 168, 0.12);
}

.tracker button,
.address-form button {
  border: 0;
  border-radius: 14px;
  padding: 0.95rem 1.2rem;
  background: linear-gradient(135deg, var(--signal), #ff6a14);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 150ms ease, filter 150ms ease;
}

.tracker button:hover,
.address-form button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hint,
.error,
.ok {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
}

.hint {
  color: #5a7384;
  line-height: 1.45;
}

.hero-tracker .hint {
  margin-top: 0.85rem;
}

.error {
  color: var(--danger);
  font-weight: 600;
}

.ok {
  color: var(--ok);
  font-weight: 600;
}

.result {
  max-width: 820px;
  margin: 0 auto 2rem;
  padding: 0 1.25rem 1rem;
  animation: lift 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-banner,
.timeline,
.meta,
.address-panel {
  background: rgba(244, 248, 251, 0.92);
  border-radius: 22px;
}

.result-banner {
  padding: 1.25rem 1.3rem;
}

.result-banner h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
}

.status-line {
  margin: 0.4rem 0 0;
  color: var(--sea-deep);
  font-weight: 600;
}

.timeline {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 1.1rem 1.3rem;
  display: grid;
  gap: 0.85rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 0.85rem 1fr;
  gap: 0.8rem;
}

.timeline .dot {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: rgba(18, 119, 168, 0.25);
}

.timeline li.done .dot {
  background: var(--sea);
}

.timeline li.fail .dot {
  background: #ff8a3d;
  box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.2);
}

.timeline li.fail .step-title {
  color: #d46312;
}

.timeline li.current .dot {
  background: var(--signal);
  box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.22);
  animation: pulse 2s ease-in-out infinite;
}

.timeline li.shipped .dot {
  background: #ff8a3d;
  box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.22);
}

.timeline li.shipped .step-title {
  color: #d46312;
}

.step-title {
  margin: 0;
  font-weight: 700;
}

.step-meta {
  margin: 0.2rem 0 0;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.meta {
  margin: 0.75rem 0 0;
  padding: 1rem 1.3rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.2rem;
}

.meta div {
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.meta dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.meta dd {
  margin: 0.25rem 0 0;
  font-weight: 600;
  line-height: 1.35;
}

.address-panel {
  margin: 0.75rem 0 0;
  padding: 1.15rem 1.3rem 1.3rem;
  border: 1.5px solid rgba(255, 138, 61, 0.45);
}

.address-panel h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.35rem;
}

.address-panel > p {
  margin: 0 0 0.9rem;
  color: var(--ink-2);
}

.address-form {
  display: grid;
  gap: 0.6rem;
}

.footer {
  padding: 1rem 1.25rem 2rem;
  text-align: center;
  color: rgba(247, 251, 255, 0.78);
  font-size: 0.85rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floaty {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(20px, 24px, 0);
  }
}

@keyframes sweep {
  0%,
  100% {
    opacity: 0.25;
    transform: rotate(-8deg) translateX(-2%);
  }
  50% {
    opacity: 0.7;
    transform: rotate(-8deg) translateX(2%);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@media (max-width: 720px) {
  .tracker-row {
    flex-direction: column;
  }

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

  .hero {
    min-height: auto;
  }

  .encomenda-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stepper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stepper-line {
    display: none;
  }

  .fail-cta {
    max-width: none;
  }
}

/* —— Página de endereço (ViaCEP) —— */
.page-endereco {
  background: #eef2f7;
  color: #16324f;
  min-height: 100vh;
}

.page-endereco .sky,
.page-endereco .orb,
.page-endereco .lane {
  display: none;
}

.endereco-hero {
  background: linear-gradient(135deg, #0b3d66 0%, #145a8c 55%, #1a6fa8 100%);
  color: #fff;
  padding: 1.2rem 1.25rem 2rem;
}

.endereco-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.logo-on-dark {
  color: #fff;
  margin-bottom: 1.2rem;
}

.endereco-hero h1 {
  margin: 0.8rem 0 0.55rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.endereco-hero p {
  margin: 0;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.endereco-main {
  max-width: 720px;
  margin: -1.1rem auto 2rem;
  padding: 0 1.1rem 2rem;
  display: grid;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}

.alert-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1.5px solid #f0a35a;
  background: #fff1e4;
}

.alert-box h2 {
  margin: 0 0 0.4rem;
  color: #c35612;
  font-size: 1rem;
}

.alert-box p {
  margin: 0;
  color: #6d4a2d;
  font-size: 0.92rem;
  line-height: 1.5;
}

.info-card {
  background: #fff;
  border-radius: 14px;
  padding: 1rem 1.15rem 1.1rem;
  box-shadow: 0 8px 24px rgba(16, 40, 70, 0.06);
}

.info-card h3 {
  margin: 0 0 0.8rem;
  color: #123a5c;
  font-size: 1.05rem;
}

.kv {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.kv div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e7edf3;
}

.kv div:first-child {
  border-top: 0;
  padding-top: 0;
}

.kv dt {
  margin: 0;
  color: #7a8ea3;
  font-size: 0.9rem;
}

.kv dd {
  margin: 0;
  color: #123a5c;
  font-weight: 700;
  text-align: right;
}

.address-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.address-card-head h3 {
  margin: 0;
}

.pin-lg {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50% 50% 50% 0;
  background: #ff6b9d;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.18);
}

.address-intro {
  margin: 0 0 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e7edf3;
  color: #6a7f94;
  font-size: 0.92rem;
}

.cep-form {
  display: grid;
  gap: 0.8rem;
}

.cep-form label {
  display: grid;
  gap: 0.35rem;
}

.cep-form label span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #123a5c;
}

.cep-form label span em {
  font-style: normal;
  color: #123a5c;
}

.cep-form input,
.cep-form select {
  width: 100%;
  border: 1.5px solid #d5dee8;
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  font: inherit;
  color: #123a5c;
  background: #fff;
  outline: none;
}

.cep-form input:focus,
.cep-form select:focus {
  border-color: #ff8a3d;
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 0.7rem;
}

.form-row-city {
  grid-template-columns: 1.6fr 0.7fr;
}

.cep-status {
  margin: -0.35rem 0 0;
  font-size: 0.84rem;
  color: #1f7a4d;
}

.cep-status.error {
  color: #c0352b;
}

.confirm-cta {
  margin-top: 0.35rem;
  border: 0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  width: 100%;
  background: linear-gradient(135deg, #ff8a3d, #ff6a14);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.confirm-cta:hover {
  filter: brightness(1.04);
}

.endereco-back {
  text-align: center;
  margin: 0.4rem 0 0;
}

.endereco-back a {
  color: #145a8c;
  font-weight: 600;
}

.page-reagendado .reagendado-main {
  width: min(560px, calc(100% - 2rem));
  margin: 2.5rem auto 3rem;
}

.reagendado-card {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 1.75rem 1.5rem 1.6rem;
  box-shadow: 0 18px 40px rgba(8, 24, 40, 0.18);
  text-align: center;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.reagendado-check {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2f9e64, #1f7a4d);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  animation: reagendado-pop 420ms ease;
}

@keyframes reagendado-pop {
  from {
    transform: scale(0.7);
    opacity: 0.4;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.reagendado-card .eyebrow {
  margin: 0.15rem 0 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1f7a4d;
}

.reagendado-card h1 {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  color: #102433;
}

.reagendado-copy {
  margin: 0;
  color: #405868;
  line-height: 1.55;
  max-width: 38ch;
}

.reagendado-address {
  margin: 0.2rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #eef6f1;
  color: #1f4d38;
  font-size: 0.92rem;
  line-height: 1.45;
  width: 100%;
  text-align: left;
}

.reagendado-actions {
  display: grid;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.55rem;
  justify-items: center;
}

.reagendado-actions .fail-cta {
  max-width: none;
}

.reagendado-secondary {
  color: #145a8c;
  font-weight: 600;
  text-decoration: none;
}

.reagendado-secondary:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .form-row,
  .form-row-city {
    grid-template-columns: 1fr;
  }
}
