/* =========================================================
   Israel Post – Mobile First, RTL Hebrew, Red & White
   ========================================================= */

:root {
  --red: #e10600;
  --red-dark: #b80500;
  --red-soft: #ffe8e7;
  --red-mid: #ff6b66;
  --white: #ffffff;
  --off-white: #faf7f7;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --border: #ead9d8;
  --success: #1a9f5c;
  --shadow: 0 12px 40px rgba(225, 6, 0, 0.12);
  --radius: 18px;
  --font: "Heebo", system-ui, sans-serif;
  --font-en: "Outfit", "Heebo", system-ui, sans-serif;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --stage-duration: 40s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(225, 6, 0, 0.08), transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(225, 6, 0, 0.06), transparent 50%),
    linear-gradient(180deg, var(--off-white) 0%, var(--white) 100%);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

body[dir="ltr"] {
  font-family: var(--font-en);
}

.page-shell {
  flex: 1;
  width: 100%;
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-logo {
  display: block;
  border-radius: 12px;
  flex-shrink: 0;
}

.brand-logo-sm {
  border-radius: 10px;
}

.brand-text {
  font-family: var(--font-en);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-text strong {
  color: var(--red);
  font-weight: 700;
}

.site-nav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem 1rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.site-nav.is-open {
  display: flex;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--red-soft);
  color: var(--red-dark);
  outline: none;
}

.nav-link.is-active {
  background: var(--red);
  color: var(--white);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}

.nav-lang {
  margin-top: 0.35rem;
  align-self: flex-start;
}

@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: static;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 0.35rem;
    background: transparent;
  }

  .nav-lang {
    margin-top: 0;
    margin-inline-start: 0.5rem;
  }
}

/* ---------- Site footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: #f5f5f5;
  padding: 2rem 1rem 0;
}

.site-footer a {
  color: #ffd0ce;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--white);
  text-decoration: underline;
}

.site-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 1.75rem;
}

.footer-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.footer-title {
  font-family: var(--font-en);
  font-size: 1.05rem;
}

.footer-title strong {
  color: #ff6b66;
}

.footer-tagline {
  color: #bdbdbd;
  font-size: 0.85rem;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff6b66;
  margin-bottom: 0.65rem;
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.footer-address {
  font-style: normal;
  line-height: 1.7;
  color: #ddd;
}

.footer-contact {
  margin-top: 0.75rem;
  line-height: 1.7;
}

.footer-bottom {
  max-width: 960px;
  margin: 1.75rem auto 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: 0.8rem;
  color: #9a9a9a;
}

@media (min-width: 720px) {
  .site-footer-inner {
    grid-template-columns: 1.4fr 1fr 1.2fr;
    align-items: start;
  }
}

/* ---------- Static pages (about / contact) ---------- */
.static-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.static-card h1 {
  text-align: start;
  margin-bottom: 0.75rem;
}

.static-card .lead {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 1rem;
}

.static-card p {
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.about-list {
  margin: 1.25rem 0 1.5rem;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
}

.contact-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

.contact-aside {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
}

.contact-aside h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--red-dark);
}

.contact-aside address {
  font-style: normal;
  margin-bottom: 0.85rem;
  line-height: 1.7;
}

.contact-aside p {
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.contact-aside a {
  color: var(--red);
}

.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
  min-height: 110px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.alert-success {
  background: #e8f8ef;
  color: #0f6b3c;
  border: 1px solid rgba(26, 159, 92, 0.25);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 600;
}

@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: start;
  }
}

.demo-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.logo-img {
  display: block;
  border-radius: 12px;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--red);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Language bar ---------- */
.lang-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
  max-width: 520px;
  margin-inline: auto;
}

.lang-toggle {
  border: 1.5px solid var(--red);
  background: var(--white);
  color: var(--red);
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  background: var(--red);
  color: var(--white);
  outline: none;
}

/* ---------- Progress bar (stage management UI) ---------- */
.progress-wrap {
  max-width: 520px;
  margin: 0.75rem auto 0;
  padding: 0 1rem;
}

.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--red), var(--red-mid));
  border-radius: inherit;
  transition: width var(--transition);
}

.progress-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition), transform var(--transition);
}

.progress-step.is-active {
  color: var(--red);
  font-weight: 700;
}

.progress-step.is-active .step-dot {
  background: var(--red);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.progress-step.is-done {
  color: var(--ink);
}

.progress-step.is-done .step-dot {
  background: var(--success);
}

/* ---------- Stages & smooth transitions ---------- */
main {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.stage {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition);
}

.stage.is-visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: stageIn 0.4s ease both;
}

@keyframes stageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem 1.75rem;
}

.card-wide {
  padding-bottom: 2rem;
}

.card-success {
  text-align: center;
  padding-block: 2.5rem;
}

/* ---------- Logo ---------- */
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  justify-content: center;
}

.logo-sm {
  margin-bottom: 0.85rem;
  transform: scale(0.92);
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.logo-text {
  font-family: var(--font-en);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.logo-text strong {
  color: var(--red);
  font-weight: 700;
}

/* ---------- Typography ---------- */
h1 {
  font-size: clamp(1.35rem, 4.5vw, 1.65rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 1rem;
}

.verify-msg {
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Shipment meta ---------- */
.shipment-meta {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--off-white);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  font-size: 0.92rem;
}

.meta-row dt {
  color: var(--muted);
  font-weight: 500;
}

.meta-row dd {
  font-weight: 600;
  text-align: end;
}

.mono {
  font-family: ui-monospace, "Courier New", monospace;
  letter-spacing: 0.02em;
  direction: ltr;
}

.status-badge {
  display: inline-block;
  background: var(--red-soft);
  color: var(--red-dark);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- Alert ---------- */
.alert {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.35rem;
  font-size: 0.9rem;
}

.alert-warn {
  background: var(--red-soft);
  color: var(--red-dark);
  border: 1px solid rgba(225, 6, 0, 0.2);
}

.alert-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.field input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.field input.is-invalid {
  border-color: var(--red);
  background: #fff8f8;
}

.field-error {
  min-height: 1.1em;
  font-size: 0.78rem;
  color: var(--red);
  font-weight: 500;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background var(--transition), opacity var(--transition);
  margin-top: 0.35rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(225, 6, 0, 0.28);
}

.btn-primary:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--red-mid);
  outline-offset: 2px;
}

/* ---------- Processing timeline + countdown timer ---------- */
.timeline {
  list-style: none;
  display: grid;
  gap: 0;
  margin-top: 0.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.75rem;
  min-height: 72px;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.timeline-item.is-active,
.timeline-item.is-done {
  opacity: 1;
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Vertical timeline connector */
.timeline-rail::after {
  content: "";
  flex: 1;
  width: 2px;
  background: var(--border);
  margin-top: 4px;
  min-height: 28px;
}

.timeline-item:last-child .timeline-rail::after {
  display: none;
}

.timeline-item.is-done .timeline-rail::after {
  background: var(--success);
}

.countdown-ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 2.5;
}

.ring-progress {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linecap: round;
  /* circumference ≈ 2 * π * 15.5 ≈ 97.4 */
  stroke-dasharray: 97.4;
  stroke-dashoffset: 97.4;
}

.timeline-item.is-active .ring-progress {
  animation: ringCountdown var(--stage-duration) linear forwards;
}

.timeline-item.is-done .ring-progress {
  stroke: var(--success);
  stroke-dashoffset: 0;
  animation: none;
}

@keyframes ringCountdown {
  from {
    stroke-dashoffset: 97.4;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.ring-icon,
.ring-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
}

.ring-check {
  display: none;
  color: var(--success);
  font-weight: 800;
  font-size: 1.15rem;
  background: var(--white);
  border-radius: 50%;
}

.timeline-item.is-done .ring-icon {
  display: none;
}

.timeline-item.is-done .ring-check {
  display: grid;
}

.timeline-body {
  padding-top: 0.55rem;
}

.timeline-text {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- OTP / Verification code input ---------- */
.otp-fieldset {
  border: none;
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.5rem 0 0.25rem;
}

.otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.otp-digit:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.otp-digit.is-invalid {
  border-color: var(--red);
  animation: shake 0.35s ease;
}

.otp-error {
  text-align: center;
  margin-top: 0.5rem;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

/* ---------- Success ---------- */
.success-check {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.25rem;
}

.success-svg {
  width: 100%;
  height: 100%;
}

.success-circle {
  fill: none;
  stroke: var(--success);
  stroke-width: 4;
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  animation: drawCircle 0.6s ease forwards;
}

.success-tick {
  fill: none;
  stroke: var(--success);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawTick 0.4s ease 0.45s forwards;
}

@keyframes drawCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawTick {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Loading screen animation ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loading-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay.is-active[hidden] {
  display: grid;
}

.loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  width: min(90vw, 320px);
  text-align: center;
}

.logo-loading {
  margin-bottom: 0;
  animation: logoPulse 1.6s ease-in-out infinite;
}

@keyframes logoPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.spinner {
  width: 44px;
  height: 44px;
}

.spinner-ring {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid var(--red-soft);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-bar {
  width: 100%;
  height: 5px;
  background: var(--red-soft);
  border-radius: 999px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--red-mid));
  border-radius: inherit;
  transition: width 0.15s linear;
}

.loading-msg {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--red-dark);
  min-height: 1.5em;
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .spinner-ring {
    animation: none;
    border-top-color: var(--red);
    opacity: 0.85;
  }

  .logo-loading {
    animation: none;
  }

  .timeline-item.is-active .ring-progress {
    animation: none;
    stroke-dashoffset: 0;
  }

  .success-circle,
  .success-tick {
    stroke-dashoffset: 0;
    animation: none;
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 640px) {
  .card {
    padding: 2rem 2rem 2.25rem;
  }

  .otp-digit {
    width: 52px;
    height: 58px;
  }

  .otp-inputs {
    gap: 0.6rem;
  }

  .progress-step {
    font-size: 0.8rem;
  }

  main {
    padding-top: 1.5rem;
  }
}
