/* ============================================================================
   Partner registration (store, delivery man, rider) — professional look.
   Loaded only on those pages, after landing-refresh.css. Style only: every
   field, name, rule and script in the forms is untouched. Remove the <link>
   and the old look returns.

   The idea: an application file. A quiet working surface, numbered sections
   (the form really is filled in order), and a side panel that keeps the
   applicant oriented. The brand colour from Business Settings is the only
   accent, used for progress and actions.
   ========================================================================== */

.rp-hero,
.reg-section.rp {
  --rp-ink: #0F2F3A;
  --rp-hero: linear-gradient(135deg, #0F4C5C 0%, #17607A 100%);
  --rp-ink-2: #34505A;
  --rp-ink-3: #5A707A;
  --rp-band: #EEF3F5;
  --rp-field: #F5F8F9;
  --rp-line: #D6E1E5;
  --rp-paper: #FFFFFF;
  --rp-accent: var(--primary, #039D55);
  --rp-accent-rgb: var(--primary-rgb, 3, 157, 85);
  --rp-accent-deep: color-mix(in srgb, var(--rp-accent) 78%, #000);
  --rp-danger: #C3281E;
  --rp-radius: 18px;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html[dir="rtl"] .rp-hero,
html[dir="rtl"] .reg-section.rp {
  font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

/* ─── Header ───────────────────────────────────────────────────────────── */

.rp-hero {
  background: #0F4C5C;
  background: var(--rp-hero);
  color: #fff;
  padding: clamp(36px, 5vw, 64px) 0 clamp(72px, 8vw, 104px);
  position: relative;
  overflow: hidden;
}

/* MARTIY: a photo behind the header instead of the teal colour; a dark shade on the text side keeps
   the white heading readable. */
.rp-hero--photo {
  background-color: #1d2327;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
.rp-hero--vendor {
  background-image: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,.12) 100%), var(--rp-hero-img);
}
.rp-hero--deliveryman {
  background-image: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,.12) 100%), var(--rp-hero-img);
}
html[dir="rtl"] .rp-hero--vendor,
html[dir="rtl"] .rp-hero--deliveryman { background-position: center left; }
html[dir="rtl"] .rp-hero--vendor {
  background-image: linear-gradient(270deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,.12) 100%), var(--rp-hero-img);
}
html[dir="rtl"] .rp-hero--deliveryman {
  background-image: linear-gradient(270deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,.12) 100%), var(--rp-hero-img);
}
@media (max-width: 767px) {
  .rp-hero--vendor,
  .rp-hero--deliveryman { background-position: 70% center; }
  .rp-hero--vendor { background-image: linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,.6)), var(--rp-hero-img); }
  .rp-hero--deliveryman { background-image: linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,.6)), var(--rp-hero-img); }
}

.rp-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
}

.rp-hero__crumb {
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .62);
  margin-bottom: 18px;
}

.rp-hero__crumb a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .3);
}

.rp-hero__crumb a:hover { color: #fff; border-bottom-color: #fff; }

.rp-hero__title {
  font-size: clamp(30px, 4.6vw, 54px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: #fff;
  margin: 0 0 16px;
  max-width: 14ch;
}

.rp-hero__intro {
  font-size: clamp(15px, 1.4vw, 17.5px);
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
  max-width: 46ch;
  margin: 0;
}

.rp-hero__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: none;
}

.rp-hero__step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}

.rp-hero__step.is-current {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .28);
}

.rp-hero__num {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--rp-ink);
  background: #fff;
}

.rp-hero__step.is-current .rp-hero__num {
  background: var(--rp-accent);
  color: #fff;
}

.rp-hero__label {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

/* ─── Working surface: form plus side panel ────────────────────────────── */

body .reg-section.rp {
  background: var(--rp-band);
  padding: 0 0 clamp(48px, 6vw, 88px);
}

.rp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
  /* The form rises into the header, so the page reads as one sheet laid on it. */
  margin-top: clamp(-64px, -6vw, -44px);
  position: relative;
  z-index: 1;
}

body .reg-section.rp .reg-container.rp-main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* ─── Section cards, numbered in order ─────────────────────────────────── */

body .reg-section.rp .rp-main { counter-reset: rp-section; }

body .reg-section.rp .reg-card,
body .reg-section.rp .card.__card {
  background: var(--rp-paper);
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius);
  padding: clamp(22px, 3vw, 36px);
  box-shadow: 0 1px 0 rgba(15, 47, 58, .04), 0 18px 40px -32px rgba(15, 47, 58, .45);
  margin-bottom: 18px;
}

body .reg-section.rp .card.__card.bg-F8F9FC { background: var(--rp-paper) !important; }

body .reg-section.rp .card.__card .card-header {
  background: none;
  border: 0;
  padding: 0;
}

body .reg-section.rp .card.__card .card-body { padding: 0 !important; }

body .reg-section.rp .card.__card .card-title,
body .reg-section.rp .sec-head {
  counter-increment: rp-section;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--rp-ink);
  margin: 0 0 24px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--rp-line);
  scroll-margin-top: 110px;
}

body .reg-section.rp .card.__card .card-title::before,
body .reg-section.rp .sec-head::before {
  content: counter(rp-section);
  flex: 0 0 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--rp-accent-deep);
  background: rgba(var(--rp-accent-rgb), .12);
}

/* The headings' own small icons repeat what the number already says. */
body .reg-section.rp .sec-head > svg,
body .reg-section.rp .sec-head > img,
body .reg-section.rp .sec-head > i { display: none; }

/* The delivery man form is one long card; its later sections need air above. */
body .reg-section.rp .reg-card .sec-head.section-gap { margin-top: 40px; }

/* The plan picker heading is centred in its own card; numbering it would be noise. */
body .reg-section.rp #business-plan-div .card-title { counter-increment: none; justify-content: center; border: 0; }
body .reg-section.rp #business-plan-div .card-title::before { display: none; }

/* ─── Fields ───────────────────────────────────────────────────────────── */

body .reg-section.rp .form-group label,
body .reg-section.rp .input-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--rp-ink-2);
  margin-bottom: 7px;
}

body .reg-section.rp .text-danger,
body .reg-section.rp .req,
body .reg-section.rp .invalid-feedback { color: var(--rp-danger); }

body .reg-section.rp .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body .reg-section.rp .form-group select,
body .reg-section.rp .form-group textarea,
body .reg-section.rp .__form-control,
body .reg-section.rp .form-control {
  min-height: 50px;
  background: var(--rp-field);
  border: 1.5px solid transparent;
  border-radius: 12px;
  color: var(--rp-ink);
  font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--rp-line);
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}

body .reg-section.rp .form-group textarea,
body .reg-section.rp textarea.form-control { min-height: 96px; }

body .reg-section.rp .form-group input:hover,
body .reg-section.rp .form-group select:hover,
body .reg-section.rp .form-control:hover { box-shadow: inset 0 0 0 1px #B4C6CD; }

body .reg-section.rp .form-group input:focus,
body .reg-section.rp .form-group select:focus,
body .reg-section.rp .form-group textarea:focus,
body .reg-section.rp .__form-control:focus,
body .reg-section.rp .form-control:focus {
  background: var(--rp-paper);
  border-color: var(--rp-accent);
  box-shadow: 0 0 0 4px rgba(var(--rp-accent-rgb), .14);
  outline: 0;
}

body .reg-section.rp .is-invalid,
body .reg-section.rp .form-control.is-invalid {
  border-color: var(--rp-danger) !important;
  box-shadow: 0 0 0 4px rgba(195, 40, 30, .1) !important;
}

/* select2 (store zone, module, cuisines) to match the native fields. */
body .reg-section.rp .select2-container--default .select2-selection--single,
body .reg-section.rp .select2-container--default .select2-selection--multiple {
  min-height: 50px;
  background: var(--rp-field);
  border: 1.5px solid transparent;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--rp-line);
}

body .reg-section.rp .select2-container--default.select2-container--focus .select2-selection--multiple,
body .reg-section.rp .select2-container--default.select2-container--open .select2-selection--single {
  background: var(--rp-paper);
  border-color: var(--rp-accent);
  box-shadow: 0 0 0 4px rgba(var(--rp-accent-rgb), .14);
}

body .reg-section.rp .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; color: var(--rp-ink); }
body .reg-section.rp .select2-container--default .select2-selection--single .select2-selection__arrow { height: 48px; }

/* Phone field with its country flag. */
body .reg-section.rp .iti { width: 100%; }
body .reg-section.rp .iti__selected-flag { border-radius: 12px 0 0 12px; background: transparent; }
html[dir="rtl"] body .reg-section.rp .iti__selected-flag { border-radius: 0 12px 12px 0; }

/* Language tabs on the store name and address. */
body .reg-section.rp .store-apply-navs,
body .reg-section.rp .nav-tabs {
  border-bottom: 1px solid var(--rp-line);
  gap: 4px;
}

body .reg-section.rp .nav-tabs .nav-link {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--rp-ink-3);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  background: none;
}

body .reg-section.rp .nav-tabs .nav-link.active {
  color: var(--rp-ink);
  border-bottom-color: var(--rp-accent);
}

/* ─── Uploads ──────────────────────────────────────────────────────────── */

body .reg-section.rp .upload-area,
body .reg-section.rp .document-upload-wrapper,
body .reg-section.rp .image--border {
  background: var(--rp-paper);
  border: 1.5px dashed #A9BDC4;
  border-radius: 14px;
  transition: border-color .15s ease, background .15s ease;
}

body .reg-section.rp .upload-area:hover,
body .reg-section.rp .document-upload-wrapper:hover,
body .reg-section.rp .image--border:hover {
  border-color: var(--rp-accent);
  background: rgba(var(--rp-accent-rgb), .04);
}

body .reg-section.rp .upload-area .upload-label { color: var(--rp-ink); font-weight: 700; }

/* ─── Phone and email verification boxes ───────────────────────────────── */
/* Their show and hide is done by the form's script through inline display,
   so only the look is set here, never display. */

body .reg-section.rp div[id$="erifyBox"] {
  margin-top: 14px !important;
  padding: 16px 18px !important;
  background: rgba(var(--rp-accent-rgb), .06) !important;
  border: 1px solid rgba(var(--rp-accent-rgb), .28) !important;
  border-radius: 14px !important;
}

body .reg-section.rp div[id$="erifyBox"] > div:first-child {
  color: var(--rp-ink-2) !important;
  font-weight: 600;
}

body .reg-section.rp button[id$="SendBtn"],
body .reg-section.rp button[id$="VerifyBtn"] {
  min-height: 42px;
  padding: 8px 18px !important;
  border-radius: 10px !important;
  background: var(--rp-accent-deep) !important;
  font-weight: 700;
  font-size: 14.5px !important;
}

body .reg-section.rp button[id$="SendBtn"]:disabled { opacity: .55; }

body .reg-section.rp input[id$="CodeInput"] {
  min-height: 42px;
  border-radius: 10px !important;
  border: 1.5px solid var(--rp-line) !important;
  letter-spacing: .2em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body .reg-section.rp span[id$="VerifiedBadge"] {
  color: var(--rp-accent-deep) !important;
  font-weight: 700;
}

/* ─── Store form stepper (general info, plan, complete) ────────────────── */

body .reg-section.rp .stepper {
  background: var(--rp-paper);
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius);
  padding: 18px 22px;
  margin-bottom: 18px !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

body .reg-section.rp .stepper-step { display: flex; align-items: center; gap: 10px; flex-direction: row; }
body .reg-section.rp .stepper-connector { flex: 1; height: 2px; min-width: 24px; background: var(--rp-line); }

body .reg-section.rp .stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 14px;
  border: 1.5px solid var(--rp-line);
  background: var(--rp-paper);
  color: var(--rp-ink-3);
}

body .reg-section.rp .stepper-step.active .stepper-circle,
body .reg-section.rp .stepper-step.completed .stepper-circle {
  background: var(--rp-accent);
  border-color: var(--rp-accent);
  color: #fff;
}

body .reg-section.rp .stepper-label { font-size: 14px; margin: 0; }

/* ─── Actions ──────────────────────────────────────────────────────────── */

body .reg-section.rp .submit-btn,
body .reg-section.rp .btn-next {
  min-height: 52px;
  padding: 14px 30px;
  border: 0;
  border-radius: 14px;
  background: var(--rp-accent-deep);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 24px -16px rgba(var(--rp-accent-rgb), 1);
  transition: background .15s ease, transform .15s ease;
}

body .reg-section.rp .submit-btn { width: 100%; }

body .reg-section.rp .submit-btn:not(:disabled):hover,
body .reg-section.rp .btn-next:not(:disabled):not(.btn-disable):hover {
  background: var(--rp-accent);
  transform: translateY(-1px);
}

body .reg-section.rp .submit-btn:disabled,
body .reg-section.rp .btn-next:disabled,
body .reg-section.rp .btn-next.btn-disable {
  background: #DAE4E8;
  color: #6A7C84;
  box-shadow: none;
  transform: none;
}

body .reg-section.rp .btn-reset,
body .reg-section.rp .btn-back {
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1.5px solid var(--rp-line);
  background: var(--rp-paper);
  color: var(--rp-ink-2);
  font-weight: 700;
}

body .reg-section.rp .btn-reset:hover,
body .reg-section.rp .btn-back:hover { border-color: var(--rp-ink-3); color: var(--rp-ink); }

body .reg-section.rp .terms-check {
  background: var(--rp-field);
  border: 1px solid var(--rp-line);
  border-radius: 14px;
}

body .reg-section.rp .terms-check input[type="checkbox"] { accent-color: var(--rp-accent); }

body .reg-section.rp :focus-visible {
  outline: 3px solid rgba(var(--rp-accent-rgb), .55);
  outline-offset: 2px;
}

/* ─── Side panel ───────────────────────────────────────────────────────── */

.rp-aside {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

.rp-panel {
  background: var(--rp-paper);
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius);
  padding: 20px;
}

.rp-panel__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--rp-ink);
  margin: 0 0 12px;
}

.rp-progress {
  height: 8px;
  border-radius: 99px;
  background: var(--rp-band);
  overflow: hidden;
}

.rp-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--rp-accent);
  transition: width .35s ease;
}

.rp-progress__text {
  margin: 8px 0 14px;
  font-size: 13px;
  color: var(--rp-ink-3);
  font-variant-numeric: tabular-nums;
}

.rp-progress__text span { font-weight: 800; color: var(--rp-ink); }

.rp-index {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rp-index;
  display: grid;
  gap: 2px;
}

.rp-index li { counter-increment: rp-index; }

.rp-index a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--rp-ink-3);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
}

.rp-index a::before {
  content: counter(rp-index);
  flex: 0 0 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--rp-band);
  color: var(--rp-ink-3);
}

.rp-index a:hover { color: var(--rp-ink); background: var(--rp-field); }

.rp-index li.is-current a { color: var(--rp-ink); background: rgba(var(--rp-accent-rgb), .08); }
.rp-index li.is-current a::before { background: var(--rp-accent); color: #fff; }

.rp-needs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rp-needs li {
  position: relative;
  padding-inline-start: 26px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--rp-ink-2);
}

/* A drawn tick, so the list needs no icon font. */
.rp-needs li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 4px;
  width: 12px;
  height: 7px;
  border-left: 2.5px solid var(--rp-accent);
  border-bottom: 2.5px solid var(--rp-accent);
  transform: rotate(-45deg);
}

.rp-panel--help a {
  display: block;
  color: var(--rp-ink);
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  padding: 3px 0;
  word-break: break-word;
}

.rp-panel--help a:hover { color: var(--rp-accent-deep); text-decoration: underline; }
.rp-help__text {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rp-ink-2, #34505a);
}
.rp-panel--help .rp-help__text + a { color: var(--rp-accent-deep, var(--rp-accent)); }

/* ─── Smaller screens ──────────────────────────────────────────────────── */

@media (max-width: 991px) {
  .rp-hero__inner { grid-template-columns: 1fr; align-items: start; }
  .rp-hero__title { max-width: none; }
  .rp-hero__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rp-hero__step { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .rp-hero__label { font-size: 13.5px; line-height: 1.3; }

  .rp-layout { grid-template-columns: 1fr; }
  /* On a phone the form comes first; what to have ready and help follow it. */
  .rp-aside { position: static; order: 2; }
  .rp-panel--index { display: none; }
}

@media (max-width: 575px) {
  .rp-hero { padding-bottom: 76px; }
  .rp-hero__steps { gap: 6px; }
  .rp-hero__step { padding: 10px; border-radius: 12px; }
  .rp-hero__num { flex-basis: 28px; width: 28px; height: 28px; font-size: 13px; }
  .rp-hero__label { font-size: 12.5px; }

  body .reg-section.rp .reg-card,
  body .reg-section.rp .card.__card { border-radius: 16px; padding: 20px 16px; }
  body .reg-section.rp .card.__card .card-title,
  body .reg-section.rp .sec-head { font-size: 17px; }
  /* Three numbers on one line; only the current step keeps its name. */
  body .reg-section.rp .stepper { padding: 12px 14px; flex-wrap: nowrap !important; gap: 8px !important; }
  body .reg-section.rp .stepper-connector { min-width: 10px; }
  body .reg-section.rp .stepper-circle { flex: 0 0 32px; }
  body .reg-section.rp .stepper-step { flex: 0 0 auto; }
  body .reg-section.rp .stepper-step:not(.active) .stepper-label { display: none; }
  body .reg-section.rp .stepper-label { font-size: 13px; white-space: nowrap; }
  /* MARTIY: four steps now; the current step's name shortens instead of pushing step 4 off screen. */
  body .reg-section.rp .stepper { gap: 6px !important; }
  body .reg-section.rp .stepper-connector { min-width: 6px; }
  body .reg-section.rp .stepper-step { min-width: 0; }
  body .reg-section.rp .stepper-step.active { flex: 0 1 auto; }
  body .reg-section.rp .stepper-step.active .stepper-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  .rp-progress__bar,
  body .reg-section.rp * { transition: none !important; }
}

/* MARTIY: first/last name beside the 1:1 photo -- names take the free width, the photo sits at the
   end of the row and is as tall as the two name fields, so both columns line up top and bottom. */
body .reg-section .row-2.photo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}
body .reg-section .row-2.photo-row > .form-group {
  display: flex;
  flex-direction: column;
}
body .reg-section .row-2.photo-row .upload-area--square {
  flex: 0 0 auto;
  width: 148px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  padding: 10px 8px;
}
body .reg-section .row-2.photo-row .upload-area--square:not(.has-preview) .upload-note { display: none; }
body .reg-section .row-2.photo-row > .form-group > label { white-space: nowrap; }
@media (max-width: 575px) {
  body .reg-section .row-2.photo-row { grid-template-columns: 1fr; }
}
