/* Bosta-inspired signup — cleaner product UI for United Express */
html:has(body.bs-signup-body),
body.bs-signup-body {
  background: #fff;
  margin: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body.bs-signup-body > .header,
body.bs-signup-body > .footer {
  display: none !important;
}

.bs-signup {
  --text: #111619;
  --muted: #667085;
  --line: #e4e7ec;
  --soft: #f9fafb;
  --brand: #422f67;
  --brand-deep: #2f2150;
  --accent: #fda63d;
  --accent-deep: #e8922a;
  --ok: #12b76a;
  --white: #ffffff;
  --radius: 8px;

  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  direction: rtl;
  font-family: 'Tajawal', sans-serif;
  color: var(--text);
  background: var(--white);
}

/* ===== Form side ===== */
.bs-signup__form-side {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background:
    radial-gradient(circle at 0% 0%, rgba(66, 47, 103, 0.04), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #fbfafd 100%);
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 100vh;
  max-height: 100dvh;
  min-width: 0;
}

.bs-signup__form-inner {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  padding: 14px 20px 18px;
  opacity: 0;
  transform: translateY(16px);
  box-sizing: border-box;
}

.bs-signup.is-ready .bs-signup__form-inner {
  animation: bs-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.bs-signup__form-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bs-signup__logo {
  color: var(--brand);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 900;
  transition: color 0.25s ease, transform 0.25s ease;
}

.bs-signup__logo:hover {
  color: var(--accent-deep);
  transform: translateY(-1px);
}

.bs-signup__login {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.bs-signup__login strong {
  color: var(--brand);
  font-weight: 800;
  border-bottom: 2px solid rgba(253, 166, 61, 0.45);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.bs-signup__login:hover strong {
  color: var(--accent-deep);
  border-color: var(--accent);
}

.bs-signup__heading {
  margin-bottom: 12px;
}

.bs-signup__badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(253, 166, 61, 0.14);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 800;
}

.bs-signup__heading h1 {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.3;
}

.bs-signup__heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.bs-signup__form-side .alert {
  margin-bottom: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  animation: bs-rise 0.45s ease both;
}

.bs-signup__form-side .alert-success h1,
.bs-signup__form-side .alert-success .text-mass {
  margin: 0;
  font-size: 0.82rem !important;
  line-height: 1.45;
}

.bs-anim-item {
  opacity: 0;
  transform: translateY(12px);
}

.bs-signup.is-ready .bs-anim-item {
  animation: bs-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(0.18s + (var(--i, 1) * 0.05s));
}

.bs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  width: 100%;
}

.bs-field {
  margin-bottom: 8px;
  min-width: 0;
}

.bs-field label {
  display: block;
  margin: 0 0 3px;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 800;
  transition: color 0.2s ease;
}

.bs-field.is-focused label {
  color: var(--brand);
}

.bs-field label em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.7rem;
}

.bs-field label b {
  color: #f04438;
  font-weight: 800;
}

.bs-field input,
.bs-field select,
.bs-field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.82rem;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.bs-field textarea {
  height: 54px;
  padding: 7px 10px;
  resize: none;
}

.bs-field input:focus,
.bs-field select:focus,
.bs-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(66, 47, 103, 0.12);
  transform: translateY(-1px);
}

.bs-field input.is-invalid,
.bs-field select.is-invalid,
.bs-field textarea.is-invalid,
.bs-check.is-invalid {
  border-color: #f04438 !important;
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(240, 68, 56, 0.12) !important;
  animation: bs-shake 0.35s ease;
}

.bs-field.has-error label {
  color: #d92d20;
}

.bs-error {
  display: none;
  margin-top: 3px;
  color: #d92d20;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
}

.bs-field.has-error .bs-error,
.bs-error.bs-error--block:not(:empty),
.bs-error:not(:empty) {
  display: block;
  animation: bs-rise 0.25s ease both;
}

.bs-error--block {
  margin: -2px 0 8px;
}

.bs-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.bs-field.has-error .bs-segment {
  border-color: #f04438;
  background: #fff5f5;
}

.bs-segment label {
  margin: 0;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.bs-segment label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bs-segment label span {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.bs-segment label.is-on {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(66, 47, 103, 0.12);
  transform: translateY(-1px);
}

.bs-segment label.is-on span {
  color: var(--brand);
}

.bs-check {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bs-check:hover {
  background: var(--soft);
}

.bs-check b {
  color: #f04438;
}

.bs-check.is-invalid,
.bs-check.has-error {
  border-color: #f04438;
  background: #fff5f5;
  color: #d92d20;
}

.bs-check input {
  margin-top: 2px;
  accent-color: var(--brand);
}

/* Google reCAPTCHA v3 — logo peeks; full text on hover */
body.bs-signup-body .grecaptcha-badge {
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 9999 !important;
  position: fixed !important;
  bottom: 14px !important;
  right: -186px !important;
  left: auto !important;
  width: 256px !important;
  height: 60px !important;
  overflow: hidden !important;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2) !important;
  transition: right 0.3s ease !important;
  pointer-events: auto !important;
}

body.bs-signup-body .grecaptcha-badge:hover,
body.bs-signup-body .grecaptcha-badge:focus-within {
  right: 4px !important;
}

.bs-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(66, 47, 103, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.bs-btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
  transform: translateX(120%);
  animation: bs-shine 3s ease-in-out infinite;
}

.bs-btn span:last-child {
  position: relative;
  z-index: 1;
}

.bs-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 14px 28px rgba(66, 47, 103, 0.28);
}

/* ===== Brand side ===== */
.bs-signup__brand-side {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #422f67 0%, #2f2150 55%, #241836 100%);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
}

.bs-signup__brand-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(253, 166, 61, 0.22), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08), transparent 30%);
  animation: bs-mesh 10s ease-in-out infinite alternate;
}

.bs-signup__orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bs-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
}

.bs-orb--1 {
  width: 160px;
  height: 160px;
  top: 12%;
  left: 8%;
  background: radial-gradient(circle, rgba(253,166,61,0.45), transparent 70%);
  animation: bs-float 8s ease-in-out infinite;
}

.bs-orb--2 {
  width: 110px;
  height: 110px;
  bottom: 18%;
  right: 10%;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 70%);
  animation: bs-float 10s ease-in-out infinite reverse;
}

.bs-orb--3 {
  width: 70px;
  height: 70px;
  top: 48%;
  right: 28%;
  background: radial-gradient(circle, rgba(253,166,61,0.3), transparent 70%);
  animation: bs-float 7s ease-in-out infinite 0.6s;
}

.bs-signup__brand-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px clamp(20px, 3vw, 40px);
  max-width: 480px;
}

.bs-signup__eyebrow {
  margin: 0 0 10px;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffc56d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bs-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(253, 166, 61, 0.5);
  animation: bs-ping 1.8s ease-out infinite;
}

.bs-signup__brand-content h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
  font-weight: 900;
  line-height: 1.3;
  color: #fff;
}

.bs-signup__brand-content h2 em {
  font-style: normal;
  background: linear-gradient(90deg, #fda63d, #ffe1a8, #fda63d);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: bs-text-shine 4s linear infinite;
}

.bs-signup__lead {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  line-height: 1.65;
}

.bs-signup__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.bs-signup__list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.bs-signup__list li:hover {
  transform: translateX(-4px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(253, 166, 61, 0.35);
}

.bs-signup__check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(253, 166, 61, 0.2);
  border: 1.5px solid var(--accent);
  position: relative;
  flex-shrink: 0;
}

.bs-signup__check::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 4px;
  width: 4px;
  height: 7px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.bs-signup__art {
  position: relative;
  margin-top: 28px;
  height: 90px;
}

.bs-box {
  position: absolute;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
}

.bs-box--1 {
  width: 150px;
  height: 90px;
  bottom: 0;
  right: 0;
  animation: bs-float 6s ease-in-out infinite;
}

.bs-box--2 {
  width: 110px;
  height: 70px;
  bottom: 20px;
  right: 120px;
  background: rgba(253, 166, 61, 0.16);
  border-color: rgba(253, 166, 61, 0.28);
  animation: bs-float 7s ease-in-out infinite reverse;
}

.bs-box--3 {
  width: 70px;
  height: 70px;
  bottom: 50px;
  right: 70px;
  border-radius: 18px;
  animation: bs-float 5s ease-in-out infinite 0.5s;
}

.bs-anim {
  opacity: 0;
  transform: translateY(16px);
}

.bs-signup.is-ready .bs-anim {
  animation: bs-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d, 0s);
}

@keyframes bs-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bs-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes bs-mesh {
  from { opacity: 0.75; transform: scale(1); }
  to { opacity: 1; transform: scale(1.06); }
}

@keyframes bs-shine {
  0%, 55% { transform: translateX(120%); }
  100% { transform: translateX(-120%); }
}

@keyframes bs-text-shine {
  to { background-position: 200% center; }
}

@keyframes bs-ping {
  0% { box-shadow: 0 0 0 0 rgba(253, 166, 61, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(253, 166, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(253, 166, 61, 0); }
}

@keyframes bs-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@media (max-width: 1199px) {
  .bs-signup {
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  }

  .bs-signup__form-inner {
    padding: 14px 16px 18px;
  }

  .bs-signup__brand-content {
    padding: 24px 18px;
  }
}

@media (max-width: 991px) {
  .bs-signup {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
  }

  .bs-signup__brand-side {
    order: -1;
    min-height: auto;
    flex: 0 0 auto;
  }

  .bs-signup__brand-content {
    padding: 16px 16px 14px;
    max-width: none;
    justify-content: flex-start;
  }

  .bs-signup__eyebrow {
    margin-bottom: 6px;
    font-size: 0.68rem;
  }

  .bs-signup__brand-content h2 {
    margin: 0 0 4px;
    font-size: 1.2rem;
    line-height: 1.35;
  }

  .bs-signup__lead,
  .bs-signup__list,
  .bs-signup__art,
  .bs-signup__orbs {
    display: none;
  }

  .bs-signup__form-side {
    order: 1;
    flex: 1 1 auto;
    max-height: none;
    overflow: visible;
    align-items: stretch;
  }

  .bs-signup__form-inner {
    max-width: none;
    padding: 14px 14px calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .bs-signup__form-top {
    margin-bottom: 8px;
    justify-content: flex-end;
  }

  .bs-signup__logo {
    display: none;
  }

  .bs-signup__login {
    font-size: 0.75rem;
  }

  .bs-signup__heading {
    margin-bottom: 12px;
  }

  .bs-signup__heading h1 {
    font-size: 1.2rem;
  }

  .bs-signup__heading p {
    font-size: 0.78rem;
  }

  .bs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .bs-field {
    margin-bottom: 10px;
  }

  .bs-field label {
    font-size: 0.78rem;
    margin-bottom: 4px;
  }

  .bs-field input,
  .bs-field select,
  .bs-field textarea {
    height: 42px;
    font-size: 16px; /* يمنع زوم iOS التلقائي */
    padding: 0 12px;
    border-radius: 10px;
    max-width: 100%;
  }

  .bs-segment {
    padding: 4px;
    border-radius: 10px;
  }

  .bs-segment label {
    height: 36px;
  }

  .bs-segment label span {
    font-size: 0.82rem;
  }

  .bs-check {
    font-size: 0.8rem;
    padding: 8px 10px;
    margin-bottom: 10px;
  }

  .bs-btn {
    height: 46px;
    font-size: 0.95rem;
    border-radius: 10px;
    position: sticky;
    bottom: 8px;
  }

  .bs-error {
    font-size: 0.72rem;
  }

  body.bs-signup-body .grecaptcha-badge {
    bottom: 10px !important;
    right: -186px !important;
    left: auto !important;
  }

  body.bs-signup-body .grecaptcha-badge:hover,
  body.bs-signup-body .grecaptcha-badge:focus-within {
    right: 4px !important;
  }
}

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

  .bs-signup__form-inner {
    padding: 12px 12px calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .bs-signup__form-top {
    flex-wrap: wrap;
    gap: 6px;
  }

  .bs-signup__heading h1 {
    font-size: 1.1rem;
  }

  .bs-field textarea {
    min-height: 72px;
  }
}

@media (max-width: 420px) {
  .bs-signup__brand-content {
    padding: 12px;
  }

  .bs-signup__brand-content h2 {
    font-size: 1.05rem;
  }

  .bs-check {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bs-signup *,
  .bs-signup *::before,
  .bs-signup *::after {
    animation: none !important;
    transition: none !important;
  }

  body.bs-signup-body .grecaptcha-badge {
    transition: right 0.3s ease !important;
  }

  .bs-anim,
  .bs-anim-item,
  .bs-signup__form-inner {
    opacity: 1 !important;
    transform: none !important;
  }
}
