/* Shared authentication components; dashboard and legacy account layouts stay scoped out. */
.auth-page { margin: 0; background: #fff; }
.auth-shell {
  --auth-primary: var(--color-primary);
  --auth-primary-hover: var(--color-primary-dark);
  --auth-text: #1e1e1e;
  --auth-muted: #536b8f;
  --auth-border: #c6c6c6;
  --auth-control-border: #808491;
  --auth-soft: var(--color-primary-light);
  --auth-danger: #b42318;
  --auth-danger-soft: #f9dce0;
  --auth-success: #166534;
  --auth-radius: 16px;
  --auth-control-height: 48px;
  --auth-input-height: 46px;
  --auth-input-size: 14px;
  --auth-card-width: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100svh;
  color: var(--auth-text);
  direction: ltr;
}
.auth-shell *, .auth-shell *::before, .auth-shell *::after { box-sizing: border-box; }
.auth-shell [hidden] { display: none !important; }
.auth-shell a { text-decoration: none; }
.auth-shell a:hover { text-decoration: underline; }
.auth-shell :where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--auth-primary);
  outline-offset: 4px;
}
.auth-skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 12px; background: #fff; color: var(--auth-primary); transform: translateY(-180%); }
.auth-skip-link:focus { transform: none; }
.auth-brand {
  position: sticky; top: 0; height: 100svh; min-height: 640px;
  overflow: hidden; border-radius: 0 64px 64px 0;
  background: #192568; color: #fff;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0;
  background: url("../img/auth/background.svg") center / cover no-repeat;
  opacity: .55; pointer-events: none;
}
.auth-brand-stage {
  position: absolute; width: 720px; height: 1024px;
  left: 50%; top: 50%; transform: translate(-50%, -50%) scale(var(--auth-art-scale, .8));
  transform-origin: center;
}
.auth-language { position: absolute; left: 39px; top: 77px; margin: 0; z-index: 1; }
.auth-language button {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  min-height: 44px; border: 1px solid #ffffff38; border-radius: 12px;
  background: #ffffff1a; color: #fff; font-size: 15px; cursor: pointer;
}
.auth-brand :where(a, button):focus-visible { outline-color: #fff; }
.auth-brand img { max-width: none; }
.auth-traffic-crop { position: absolute; right: 32px; top: 32px; width: 95px; height: 105px; overflow: hidden; transform: scale(var(--auth-art-scale, .8)); transform-origin: top right; }
.auth-traffic-crop img { position: absolute; width: 272.36%; height: 178.29%; left: -89.76%; top: -37.48%; }
.auth-brand-logo { position: absolute; left: 218px; top: 176px; }
.auth-brand-title {
  position: absolute; left: 105px; top: 316px; width: 528px;
  margin: 0; font-size: 40px; line-height: 1.6; font-weight: 600; text-align: center; direction: rtl;
}
.auth-car-motion { position: absolute; left: 97px; top: 564px; width: 542px; height: 171px; }
.auth-car-crop { width: 542px; height: 171px; position: relative; overflow: hidden; transform: scaleX(-1); }
.auth-car-crop img { position: absolute; width: 100%; height: 235.37%; left: 0; top: -75%; }
.auth-brand-dots { position: absolute; left: 352px; top: 811px; }
/* Shared login/signup showcase. Only the cars move; the brand panel stays still. */
.auth-car-carousel { --auth-car-control-size: max(44px, calc(44px / var(--auth-art-scale, 1))); }
.auth-car-track { position: absolute; left: 0; top: 475px; width: 720px; height: 260px; pointer-events: none; }
.auth-car-slide { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.auth-car-slide[hidden], .auth-carousel-controls[hidden] { display: none; }
.auth-car-slide .auth-car-crop { flex-shrink: 0; }
.auth-car-cutout-frame { position: relative; width: 542px; height: 260px; flex-shrink: 0; isolation: isolate; transform: scaleX(-1); }
.auth-car-cutout-frame--profile { transform: translateY(54px) scaleX(-1); }
.auth-car-cutout { position: relative; z-index: 1; width: 542px; height: 260px; object-fit: contain; object-position: center bottom; }
/* Rim cutouts are projected back into each photographed wheel's perspective. */
.auth-car-wheel { position: absolute; z-index: 2; opacity: 0; border-radius: 50%; overflow: hidden; pointer-events: none; mask-image: radial-gradient(circle, #000 62%, #000b 67%, transparent 71%); }
.auth-car-wheel canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.auth-car-smoke { position: absolute; z-index: 0; width: 82px; height: 48px; margin: -36px 0 0 -22px; opacity: 0; border-radius: 50%; pointer-events: none; background: radial-gradient(ellipse at 40% 64%, #dde3ef80 0%, #c9d3e65c 25%, #b7c4df26 46%, #b7c4df00 72%); }
.auth-carousel-controls { position: absolute; top: 786px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; direction: ltr; }
.auth-carousel-controls button { width: var(--auth-car-control-size); height: var(--auth-car-control-size); padding: 0; border: 0; display: grid; place-items: center; border-radius: 50%; color: #fff; background: transparent; cursor: pointer; }
.auth-carousel-controls button[hidden] { display: none; }
.auth-carousel-dot span { display: block; width: 5px; height: 5px; border-radius: 99px; background: #ffffff70; transition: width 240ms ease, background-color 240ms ease; }
.auth-carousel-dot[aria-pressed="true"] span { width: 24px; background: #fff; }
.auth-carousel-controls button:hover { background: #ffffff12; }
.auth-carousel-toggle { font-size: 18px; opacity: .8; }
@media (prefers-reduced-motion: reduce) {
  .auth-carousel-dot span { transition: none; }
  .auth-car-wheel, .auth-car-smoke { display: none; }
}
.auth-support { position: absolute; left: 260px; top: 855px; width: 201px; display: flex; justify-content: space-between; }
.auth-support-item { color: #fff; width: max(78px, calc(44px / var(--auth-art-scale, 1))); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: max(16px, calc(14px / var(--auth-art-scale, 1))); white-space: nowrap; }
.auth-support-icon { width: max(62px, calc(44px / var(--auth-art-scale, 1))); height: max(62px, calc(44px / var(--auth-art-scale, 1))); display: grid; place-items: center; border-radius: 16px; background: #ffffff26; }
.auth-main { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 40px; outline: none; }
html[dir="rtl"] .auth-main, html[dir="rtl"] .auth-dialog { direction: rtl; }
.auth-card { width: 100%; max-width: var(--auth-card-width); padding: 26px 22px; border: 1px solid var(--auth-border); border-radius: 24px; background: #fff; }
.auth-card--signup { border-color: #e6e6e6; }
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-header h1 { font-size: clamp(22px, 1.7vw, 26px); line-height: 1.45; font-weight: 600; margin: 0; }
.auth-header p { color: var(--auth-muted); font-size: 16px; line-height: 1.7; margin: 0; }
.auth-heading-image { position: relative; overflow: hidden; margin: 4px auto 18px; }
.auth-heading-image img { position: absolute; max-width: none; }
.auth-heading-image--user { width: 80px; height: 85px; }
.auth-heading-image--user img { width: 190.06%; height: 177.95%; left: -43.48%; top: -31.21%; }
.auth-heading-image--reset { width: 92px; height: 84px; }
.auth-heading-image--reset img { width: 160.93%; height: 118.25%; left: -30.46%; top: -8.03%; }
.auth-heading-image--otp { width: 70px; height: 85px; }
.auth-heading-image--otp img { width: 239.68%; height: 131.88%; left: -70.9%; top: -15.72%; }
.auth-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.auth-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.auth-field label { font-size: 14px; line-height: 1.5; font-weight: 500; }
.auth-required { color: var(--auth-danger); }
.auth-control { display: flex; align-items: center; min-height: var(--auth-control-height); border: 1px solid var(--auth-control-border); border-radius: var(--auth-radius); background: #fff; overflow: visible; }
.auth-control:focus-within { border-color: var(--auth-primary); outline: 2px solid var(--auth-primary); outline-offset: 2px; }
.auth-shell .auth-input {
  display: block; width: 100%; min-width: 0; min-height: var(--auth-input-height); margin: 0;
  padding: 10px 14px; border: 0; border-radius: var(--auth-radius);
  background: transparent; font-size: var(--auth-input-size); line-height: 1.5; color: var(--auth-text);
}
.auth-shell .auth-input:focus { outline: none; box-shadow: none; }
.auth-input::placeholder { color: #6c6c6c; opacity: 1; }
.auth-control--phone .auth-input { flex: 1; direction: ltr; text-align: end; }
html[dir="ltr"] .auth-control--phone .auth-input { text-align: start; }
.auth-country { display: flex; align-items: center; flex-shrink: 0; gap: 5px; padding-inline: 12px; border-inline-end: 1px solid var(--auth-border); color: var(--auth-muted); font-size: 14px; white-space: nowrap; }
html[dir="rtl"] .auth-country { border-inline-end: 0; border-inline-start: 1px solid var(--auth-border); }
.auth-control--password .auth-input { flex: 1; }
.auth-control--password .auth-input::-ms-reveal { display: none; }
.auth-icon-button { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; margin-inline-end: 6px; background: transparent; border: 0; border-radius: 10px; color: var(--auth-muted); cursor: pointer; }
.auth-icon-button:hover { background: var(--auth-soft); }
.auth-field.has-error .auth-control, .auth-control.is-invalid { border-color: var(--auth-danger); }
.auth-control.is-valid { border-color: var(--auth-success); }
.auth-field-error, .auth-alert { font-size: 14px; color: var(--auth-danger); line-height: 1.6; }
.auth-alert { padding: 14px 16px; border: 1px solid #fda29b; background: #fff4f2; border-radius: var(--auth-radius); }
.auth-help { font-size: 13px; line-height: 1.7; color: var(--auth-muted); margin: 0; }
.auth-help.is-invalid { color: var(--auth-danger); }
.auth-help.is-valid { color: var(--auth-success); }
.auth-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.auth-checkbox { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--auth-muted); cursor: pointer; }
.auth-checkbox input { width: 20px; height: 20px; accent-color: var(--auth-primary); flex-shrink: 0; }
.auth-terms { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.auth-terms .auth-checkbox input { width: 18px; height: 18px; }
.auth-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; color: var(--auth-primary); font-size: 14px; font-weight: 500; }
#otp-resend:disabled { color: var(--auth-muted); opacity: .65; cursor: not-allowed; }
.auth-button { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: var(--auth-control-height); padding: 10px 18px; border: 0; border-radius: var(--auth-radius); background: var(--auth-primary); color: #fff; font-size: 18px; line-height: 1.5; font-weight: 500; cursor: pointer; transition: background-color 180ms, box-shadow 180ms; }
.auth-button:hover { background: var(--auth-primary-hover); box-shadow: 0 6px 18px #323ca722; }
.auth-button:disabled { cursor: not-allowed; opacity: .65; }
#signup-form #submit-btn:disabled { background: #ccc; color: #fff; opacity: 1; box-shadow: none; }
.auth-button--secondary { background: var(--auth-soft); color: var(--auth-primary); }
.auth-button--secondary:hover { background: #dcdff4; }
.auth-footer { margin: 0; text-align: center; color: var(--auth-muted); font-size: 14px; }
.auth-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.auth-form-grid > .auth-field--full { grid-column: 1 / -1; }
.auth-step { border: 0; min-width: 0; padding: 0; margin: 0; }
.auth-step legend { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.auth-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.auth-progress button { padding: 10px 6px; min-height: 44px; border: 0; border-top: 8px solid var(--auth-soft); border-radius: 6px 6px 0 0; color: var(--auth-muted); background: transparent; text-align: start; font-size: 14px; cursor: pointer; }
.auth-progress button[aria-current="step"] { border-color: var(--auth-primary); color: var(--auth-primary); font-weight: 600; }
.auth-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-actions .auth-button:only-child, .auth-actions .auth-button:only-of-type { grid-column: 1 / -1; }
.auth-actions:has([data-step-previous][hidden]) [data-step-next], .auth-actions:has([data-step-previous][hidden]) #submit-btn { grid-column: 1 / -1; }
.auth-map-button { min-height: var(--auth-control-height); width: 100%; padding: 10px; border: 1px dashed var(--auth-control-border); border-radius: var(--auth-radius); background: #fff; color: var(--auth-muted); cursor: pointer; }
.auth-map-button:hover { border-color: var(--auth-primary); color: var(--auth-primary); }
.auth-map-button[aria-invalid="true"] { border-color: var(--auth-danger); }
.auth-map-status { padding: 12px; border-radius: 12px; background: #f0fdf4; color: var(--auth-success); font-size: 13px; }
.auth-shell .select2-container { max-width: 100%; min-width: 0; }
.auth-shell .select2-container--default .select2-selection--single { min-height: var(--auth-input-height) !important; border: 0 !important; border-radius: var(--auth-radius) !important; padding: 10px 14px !important; box-shadow: none !important; }
.auth-shell .select2-container--default .select2-selection--single .select2-selection__rendered { font-size: var(--auth-input-size) !important; color: var(--auth-text) !important; padding-inline-end: 22px !important; }
.auth-shell .select2-container--default .select2-selection--single .select2-selection__arrow { right: auto !important; inset-inline-end: 12px !important; }
.auth-page .select2-dropdown { border-color: var(--color-primary) !important; }
.auth-dialog { margin: auto; border: 1px solid var(--auth-border); border-radius: 24px; width: min(680px, calc(100% - 32px)); max-height: calc(100svh - 32px); padding: 24px; color: var(--auth-text); }
.auth-dialog::backdrop { background: #0f172a99; }
.auth-dialog h2 { margin: 0; font-size: 22px; }
.auth-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-dialog-body { max-height: 55svh; overflow: auto; padding: 4px; line-height: 1.8; }
.auth-dialog .auth-actions { margin-top: 20px; }
.auth-dialog--confirm { --auth-control-height: 44px; width: min(480px, calc(100% - 32px)); padding: 28px 24px 24px; text-align: center; }
.auth-confirm-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: radial-gradient(circle at 30% 20%, #849cff 0%, #4158ff 38%, #2333cf 75%, #1825a9 100%); box-shadow: inset 0 3px 3px #ffffff66, inset -4px -4px 8px #1622b14d; color: #fff; font: italic 600 36px/1 sans-serif; }
.auth-dialog--confirm h2 { margin-bottom: 12px; font-size: 20px; font-weight: 600; }
.auth-dialog--confirm .auth-help { font-size: 13px; }
.auth-dialog--confirm .auth-actions { margin-top: 20px; }
.auth-dialog--confirm .auth-button { padding: 8px 14px; border-radius: 12px; font-size: 14px; }
.auth-button--cancel { background: var(--auth-danger-soft); color: var(--auth-danger); }
.auth-button--cancel:hover { background: #f2c6cf; box-shadow: none; }
#google-map-container { height: 350px; border-radius: 16px; }
.otp-digit-row { display: flex; position: relative; justify-content: center; gap: clamp(6px, 1vw, 18px); direction: ltr; }
.auth-shell .otp-digit { width: min(56px, 14%); min-width: 0; height: 56px; border: 1px solid var(--auth-control-border); border-radius: var(--auth-radius); background: var(--auth-soft); color: var(--auth-text); text-align: center; font-size: 22px; }
.auth-shell .otp-digit:focus { border-color: var(--auth-primary); outline: 3px solid #323ca733; outline-offset: 2px; }
.otp-digit.is-filled { border-color: var(--auth-primary); }
.otp-digit-row.has-error .otp-digit { border-color: var(--auth-danger); }
.otp-digit-row.is-verifying .otp-digit { visibility: hidden; }
.otp-submit-spinner { display: none; position: absolute; left: calc(50% - 14px); top: calc(50% - 14px); width: 28px; height: 28px; border: 3px solid #323ca733; border-top-color: var(--auth-primary); border-radius: 50%; }
.otp-digit-row.is-verifying .otp-submit-spinner { display: block; }
.auth-otp-input { border: 1px solid var(--auth-border) !important; text-align: center; letter-spacing: .35em; }
.auth-shell .auth-otp-input:focus-visible { outline: 3px solid var(--auth-primary); outline-offset: 3px; }
.auth-field:has(.otp-digit-row) > label, .otp-pending-message { text-align: center; }
.auth-shell--success { grid-template-columns: minmax(0, 1fr); background: radial-gradient(ellipse at center, #ffffff40, transparent 65%), #192568 url("../img/onboarding/completed-background.svg") center / cover no-repeat; }
.auth-card--success { --auth-control-height: 60px; max-width: 768px; padding: 40px 64px 64px; border-color: #e6e6e6; border-radius: 32px; }
.auth-success-art { display: block; width: 210px; height: auto; margin: 0 auto 16px; }
.auth-card--success .auth-header { margin-bottom: 28px; }
.auth-card--success .auth-header h1 { font-size: 28px; }
.auth-card--success .auth-header p { font-size: 14px; }
.auth-credentials { display: grid; gap: 24px; padding: 24px; margin: 0; border: 1px solid #e6e6e6; border-radius: 24px; background: #fff; }
.auth-credential-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.auth-credential-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--auth-soft); color: var(--auth-primary); font-size: 34px; }
.auth-credential-phone { width: 34px; height: 34px; background: currentColor; mask: url("../img/auth/call.svg") center / contain no-repeat; }
.auth-credential-detail { min-width: 0; }
.auth-credential-detail dt { color: var(--auth-primary); font-size: 14px; line-height: 1.7; }
.auth-credential-detail dd { margin: 0; font-size: 18px; line-height: 1.7; overflow-wrap: anywhere; }
.auth-copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 12px; border: 1px solid #e6e6e6; border-radius: 8px; background: #fff; color: var(--auth-primary); font-size: 13px; white-space: nowrap; cursor: pointer; }
.auth-copy-button:hover { background: var(--auth-soft); }
.auth-success-form { margin-top: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .auth-card { animation: auth-card-enter 420ms ease-out both; }
  .auth-car-motion { animation: auth-car-enter 800ms cubic-bezier(.2,.7,.2,1) both; }
  .auth-brand-logo { animation: auth-logo-enter 600ms ease-out both; }
  .otp-submit-spinner { animation: auth-spin 800ms linear infinite; }
  .auth-step { animation: auth-card-enter 240ms ease-out both; }
  @keyframes auth-card-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes auth-car-enter { from { opacity: 0; transform: translateX(-70px); } to { opacity: 1; transform: none; } }
  @keyframes auth-logo-enter { from { opacity: 0; } to { opacity: 1; } }
  @keyframes auth-spin { to { transform: rotate(360deg); } }
}
@media (max-width: 1050px) { .auth-main { padding: 28px; } .auth-form-grid { grid-template-columns: minmax(0, 1fr); } .auth-form-grid > .auth-field--full { grid-column: auto; } }
/* Keep the forms proportionate on laptop screens and at browser zoom. */
@media (min-width: 768px) and (max-height: 850px) {
  .auth-shell { --auth-control-height: 44px; --auth-input-height: 42px; }
  .auth-main { padding: 24px; }
  .auth-card { padding: 22px; }
  .auth-header { margin-bottom: 16px; }
  .auth-header h1 { font-size: 24px; }
  .auth-header p { font-size: 14px; }
  .auth-form { gap: 12px; }
  .auth-field { gap: 6px; }
  .auth-form-grid { gap: 12px 14px; }
  .auth-progress { margin-bottom: 0; }
  .auth-heading-image { margin-bottom: 14px; }
  .auth-card--signup:has([data-auth-step][hidden]) .auth-step legend {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
@media (max-width: 767px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { position: relative; height: 260px; min-height: 0; border-radius: 0 0 32px 32px; }
  .auth-brand-stage { width: 100%; height: 260px; position: relative; left: auto; top: auto; transform: none; }
  .auth-language { left: 16px; top: 16px; }
  .auth-language button { font-size: 14px; padding: 6px 8px; }
  .auth-traffic-crop { left: auto; right: 20px; top: 14px; transform: scale(.52); transform-origin: top right; }
  .auth-brand-logo { top: 60px; left: 50%; transform: translateX(-50%) scale(.55); transform-origin: top center; }
  .auth-brand-title { top: 144px; left: 8%; width: 84%; font-size: 19px; line-height: 1.55; }
  .auth-car-motion { top: 211px; left: calc(50% - 271px); transform: scale(.3); transform-origin: top center; animation: none; }
  .auth-brand-dots, .auth-support { display: none; }
  .auth-brand:has([data-auth-carousel]), .auth-brand:has([data-auth-carousel]) .auth-brand-stage { height: 316px; }
  .auth-car-carousel { --auth-car-control-size: 44px; }
  .auth-car-track { top: 205px; left: calc(50% - 360px); transform: scale(.24); transform-origin: top center; }
  .auth-carousel-controls { top: 270px; }
  .auth-main { padding: 24px 16px 32px; align-items: flex-start; }
  .auth-card { padding: 24px 18px; border-radius: 24px; }
  .auth-heading-image { margin-bottom: 16px; }
  .auth-button { font-size: 18px; }
  .auth-actions { gap: 10px; }
  .auth-header p { font-size: 15px; }
  .auth-shell .otp-digit { height: 52px; border-radius: 12px; font-size: 22px; }
  .auth-shell--success .auth-main { align-items: center; }
  .auth-card--success { padding: 28px 20px; }
  .auth-card--success .auth-header h1 { font-size: 23px; }
  .auth-success-art { width: 150px; }
  .auth-credentials { padding: 16px 12px; gap: 20px; border-radius: 18px; }
  .auth-credential-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; }
  .auth-credential-icon { width: 44px; height: 44px; border-radius: 12px; font-size: 24px; }
  .auth-credential-phone { width: 24px; height: 24px; }
  .auth-credential-detail dt { font-size: 12px; }
  .auth-credential-detail dd { font-size: 14px; }
  .auth-copy-button { padding: 6px; font-size: 12px; gap: 4px; }
  .auth-dialog--confirm { padding: 24px 20px; }
}
