:root {
  --aramex-red: #dc291e;
  --aramex-red-dark: #b81f16;
  --ink: #1a1a1a;
  --muted: #66707a;
  --line: #e4e7ea;
  --soft: #f7f8f9;
  --white: #ffffff;
  --ok: #1b7a4e;
  --danger: #b42318;
  --radius: 10px;
  --font: "IBM Plex Sans", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --sheet-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: #eceff2;
  -webkit-text-size-adjust: 100%;
}

html[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "IBM Plex Sans", sans-serif;
}

.topbar {
  background: var(--white);
  border-bottom: 3px solid var(--aramex-red);
}

.topbar-inner {
  width: min(560px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-word {
  display: inline-block;
  color: var(--aramex-red);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  text-transform: lowercase;
}

.topbar-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: end;
  max-width: 46%;
  line-height: 1.25;
}

.page {
  width: min(560px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

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

.status-block {
  padding: 20px 20px 16px;
  border-left: 4px solid var(--aramex-red);
}

html[dir="rtl"] .status-block {
  border-left: 0;
  border-right: 4px solid var(--aramex-red);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(27, 122, 78, 0.14);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eaf7f0;
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-block h1 {
  margin: 0 0 8px;
  font-size: clamp(1.28rem, 4.2vw, 1.55rem);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.shipment-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.meta-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.amount-block {
  margin: 0;
  padding: 16px 20px;
  background: #fff8f7;
  border-top: 1px solid #f0d2cf;
  border-bottom: 1px solid #f0d2cf;
}

.amount-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.amount-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.amount-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--aramex-red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.amount-value {
  margin: 0;
  color: var(--aramex-red);
  font-size: clamp(1.75rem, 6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.amount-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.amount-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #efc4c0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pay-form {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.section-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #3d4650;
  min-width: 0;
}

.field-grid label.full {
  grid-column: 1 / -1;
}

.field-grid input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.3;
}

.field-grid input:focus {
  outline: none;
  border-color: var(--aramex-red);
  box-shadow: 0 0 0 3px rgba(220, 41, 30, 0.14);
}

.card-block {
  margin: 0;
  padding: 4px 2px 0;
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
}

#payment-gateway-iframe {
  display: block;
  width: 100%;
  height: 168px;
  border: 0;
  background: #f7f7f7;
}

.cta {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 6px;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--aramex-red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.cta:hover { background: var(--aramex-red-dark); }
.cta:disabled {
  opacity: 0.65;
  cursor: wait;
}

.trust-row {
  list-style: none;
  margin: 2px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 8px;
}

.trust-row li {
  flex: 1 1 90px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 500;
  min-width: 0;
}

.trust-row svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--aramex-red);
}

.secure-note {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.form-error {
  margin: 0;
  padding: 11px 12px;
  border-radius: 6px;
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #fecdca;
  font-size: 0.88rem;
}

.site-foot {
  padding: 14px 6px 0;
}

.site-foot p {
  margin: 0;
  text-align: center;
  color: #8a939c;
  font-size: 0.72rem;
  line-height: 1.45;
}

.thanks-wrap { padding-top: 8px; }

.thanks-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sheet-shadow);
  padding: 28px 22px;
  text-align: center;
}

.thanks-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #eaf7f0;
  color: var(--ok);
  display: grid;
  place-items: center;
}

.thanks-icon svg { width: 28px; height: 28px; }

.thanks-card h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.busy::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: all;
  z-index: 50;
}

@media (max-width: 520px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

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

  .trust-row {
    flex-direction: column;
  }

  .trust-row li {
    flex: 0 0 auto;
  }
}
