/* Auth — Bakkah-style split (form + image panel) */

.auth-body.auth-bakkah-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Tajawal', system-ui, sans-serif;
  background: #fff;
  color: #1a1a2e;
  -webkit-font-smoothing: antialiased;
}

html[dir="ltr"] .auth-body.auth-bakkah-body {
  font-family: 'Inter', 'Tajawal', system-ui, sans-serif;
}

.auth-bakkah {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

html[dir="rtl"] .auth-bakkah {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
}

html[dir="ltr"] .auth-bakkah--register {
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
}

html[dir="rtl"] .auth-bakkah--register {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
}

.auth-bakkah--solo {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px 16px;
}

.auth-bakkah__form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 5vw, 56px);
  background: #fff;
}

html[dir="rtl"] .auth-bakkah__form-side {
  order: 2;
}

html[dir="ltr"] .auth-bakkah__form-side {
  order: 1;
}

.auth-bakkah__form-inner {
  width: min(100%, 400px);
}

.auth-bakkah__form-inner--wide {
  width: min(100%, 540px);
}

.auth-bakkah--register .auth-bakkah__form-side {
  align-items: flex-start;
  overflow-y: auto;
  max-height: 100vh;
  padding-top: clamp(20px, 3vw, 36px);
  padding-bottom: clamp(28px, 4vw, 48px);
}

.auth-bakkah__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-bakkah__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-bakkah__back:hover {
  color: #0B1426;
}

.auth-bakkah__brand-mark {
  text-align: center;
  margin-bottom: 24px;
  line-height: 0;
}

.auth-bakkah__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.35);
}

.auth-bakkah__head {
  text-align: center;
  margin-bottom: 24px;
}

.auth-bakkah__title {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 900;
  color: #111827;
}

.auth-bakkah__subtitle {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #6b7280;
}

.auth-bakkah__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 14px;
  background: #f3f4f6;
}

.auth-bakkah__tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  color: #6b7280;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-bakkah__tab.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #0b1426 0%, #152238 100%);
  box-shadow: 0 6px 16px rgba(11, 20, 38, 0.18);
}

.auth-bakkah__alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
}

.auth-bakkah__invite {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #F3F2EF;
  border: 1px solid #E0E0E0;
  color: #070D18;
  font-size: 13px;
  font-weight: 600;
}

.auth-bakkah__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
}

.auth-bakkah__field {
  position: relative;
  margin-bottom: 18px;
}

.auth-bakkah__input {
  width: 100%;
  min-height: 52px;
  padding: 0 44px 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: #111827;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html[dir="rtl"] .auth-bakkah__input {
  padding: 0 16px 0 44px;
}

.auth-bakkah__input:focus {
  outline: none;
  border-color: #0B1426;
  box-shadow: 0 0 0 3px rgba(11, 20, 38, 0.12);
}

.auth-bakkah__field-icon {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.auth-bakkah__field-icon svg {
  width: 20px;
  height: 20px;
}

.auth-bakkah__toggle-pass {
  position: absolute;
  inset-inline-end: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
}

.auth-bakkah__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.auth-bakkah__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
}

.auth-bakkah__link {
  font-size: 14px;
  font-weight: 700;
  color: #0B1426;
  text-decoration: none;
}

.auth-bakkah__link:hover {
  text-decoration: underline;
}

.auth-bakkah__submit {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(249, 115, 22, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-bakkah__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(249, 115, 22, 0.42);
}

.auth-bakkah__footer {
  margin-top: 20px;
  text-align: center;
}

.auth-bakkah__footer a {
  font-size: 14px;
  font-weight: 700;
  color: #0B1426;
  text-decoration: none;
}

.auth-bakkah__footer a:hover {
  text-decoration: underline;
}

.auth-bakkah__institution {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.6;
}

.auth-bakkah__institution a {
  color: #ea580c;
  font-weight: 800;
  text-decoration: none;
}

.auth-bakkah__institution a:hover {
  text-decoration: underline;
}

/* Register form — match Bakkah inputs inside split layout */
.auth-bakkah__form--register .auth-form-block {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 14px;
  background: #fafafa;
  border: 1px solid #eceff3;
  box-shadow: none;
}

.auth-bakkah__form--register .auth-form-block__title {
  display: none;
}

.auth-bakkah__form--register .auth-form-block + .auth-form-block {
  margin-top: 4px;
}

.auth-bakkah__form--register .auth-form-block__title::before {
  background: #f97316;
}

.auth-bakkah__form--register .auth-input__label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

html[dir="rtl"] .auth-bakkah__form--register .auth-input--phone .auth-control,
html[dir="rtl"] .auth-bakkah__form--register .auth-input--phone .auth-phone-input {
  text-align: end;
  direction: ltr;
  unicode-bidi: plaintext;
}

.auth-bakkah__form--register .auth-control,
.auth-bakkah__form--register .auth-field input:not([type="checkbox"]):not(.auth-phone-input),
.auth-bakkah__form--register .auth-country-picker__trigger {
  border-color: #e5e7eb;
  border-radius: 12px;
}

.auth-bakkah__form--register .auth-field--phone {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-bakkah__form--register .auth-field--phone .auth-phone-combo {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 52px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}

.auth-bakkah__form--register .auth-field--phone:focus-within .auth-phone-combo {
  border-color: #0B1426;
  box-shadow: 0 0 0 3px rgba(11, 20, 38, 0.12);
}

.auth-bakkah__form--register .auth-phone-prefix__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  height: 100%;
  padding: 0 10px 0 12px;
  margin: 0;
  border: 0;
  border-inline-end: 1px solid #e5e7eb;
  border-radius: 0;
  background: #f8fafc;
  color: #0b1426;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.auth-bakkah__form--register .auth-phone-prefix__trigger:hover,
.auth-bakkah__form--register .auth-phone-prefix-picker.is-open .auth-phone-prefix__trigger {
  background: #fff7ed;
}

.auth-bakkah__form--register .auth-phone-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  min-height: 52px;
  padding: 0 12px;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}

.auth-bakkah__form--register .auth-control:focus,
.auth-bakkah__form--register .auth-field input:focus:not(.auth-phone-input),
.auth-bakkah__form--register .auth-country-picker.is-open .auth-country-picker__trigger,
.auth-bakkah__form--register .auth-country-picker__trigger:focus,
.auth-bakkah__form--register .auth-field--phone:focus-within .auth-phone-combo,
.auth-bakkah__form--register .auth-role-select-wrap .auth-role-select:focus {
  border-color: #0B1426;
  box-shadow: 0 0 0 3px rgba(11, 20, 38, 0.12);
}

.auth-bakkah__form--register .auth-form-grid {
  gap: 10px;
}

/* Select fields — visible box + chevron */
.auth-bakkah__form--register .auth-field--select,
.auth-trainer-wizard .auth-field--select {
  position: relative;
}

.auth-bakkah__form--register .auth-field--select select.auth-control,
.auth-trainer-wizard .auth-field--select select.auth-control {
  width: 100%;
  min-height: 52px;
  padding: 0 44px 0 14px;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-bakkah__form--register .auth-field--select select.auth-control:focus,
.auth-trainer-wizard .auth-field--select select.auth-control:focus {
  border-color: #0b1426;
  box-shadow: 0 0 0 3px rgba(11, 20, 38, 0.12);
  outline: none;
}

.auth-bakkah__form--register .auth-field--select select.auth-control:invalid,
.auth-trainer-wizard .auth-field--select select.auth-control:invalid {
  color: #94a3b8;
}

.auth-bakkah__form--register .auth-field--select::after,
.auth-trainer-wizard .auth-field--select::after {
  content: "";
  position: absolute;
  inset-inline-end: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -2px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

@media (min-width: 640px) {
  .auth-bakkah__form--register .auth-form-grid--basic {
    grid-template-columns: 1fr;
  }

  .auth-bakkah__form--register .auth-form-grid--contact {
    grid-template-columns: 1fr;
  }

  .auth-bakkah__form--register .auth-form-grid--contact:has(.auth-input--country) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-bakkah__form--register .auth-input--email,
  .auth-bakkah__form--register .auth-input--phone {
    grid-column: 1 / -1;
  }

  .auth-bakkah__form--register .auth-form-grid--contact:has(.auth-input--country) .auth-input--phone {
    grid-column: auto;
  }

  .auth-bakkah__form--register .auth-form-block--security .auth-form-grid {
    grid-template-columns: 1fr;
  }
}

.auth-bakkah__form--register .auth-alert-pro {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.auth-bakkah__form--register .auth-alert-pro.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Visual panel */
.auth-bakkah__visual {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 320px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(30, 10, 60, 0.15) 0%, rgba(30, 10, 60, 0.55) 100%),
    var(--auth-panel-image, none) center / cover no-repeat,
    linear-gradient(145deg, #070D18 0%, #0B1426 50%, #0B1426 100%);
}

html[dir="rtl"] .auth-bakkah__visual {
  order: 1;
}

html[dir="ltr"] .auth-bakkah__visual {
  order: 2;
}

.auth-bakkah__visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 20, 38, 0.15) 0%, rgba(11, 20, 38, 0.45) 100%);
  pointer-events: none;
}

.auth-bakkah__visual-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  padding: clamp(32px, 6vw, 64px) clamp(28px, 5vw, 56px);
  text-align: center;
  color: #fff;
}

.auth-bakkah__visual-title {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.35;
  max-width: 18ch;
}

.auth-bakkah__visual-underline {
  display: block;
  width: min(120px, 50%);
  height: 6px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #f97316, #fbbf24);
}

.auth-bakkah__visual-lead {
  margin: 0 0 12px;
  max-width: 36ch;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
}

.auth-bakkah__visual-note {
  margin: 0;
  max-width: 32ch;
  font-size: 15px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 960px) {
  .auth-bakkah,
  html[dir="rtl"] .auth-bakkah,
  html[dir="ltr"] .auth-bakkah {
    grid-template-columns: 1fr;
  }

  html[dir="rtl"] .auth-bakkah__form-side,
  html[dir="ltr"] .auth-bakkah__form-side {
    order: 2;
  }

  html[dir="rtl"] .auth-bakkah__visual,
  html[dir="ltr"] .auth-bakkah__visual {
    position: relative;
    top: auto;
    height: auto;
    order: 1;
    min-height: clamp(220px, 38vw, 320px);
  }

  .auth-bakkah--register .auth-bakkah__form-side {
    max-height: none;
    overflow: visible;
  }

  .auth-bakkah__visual-content {
    padding: 28px 24px;
  }

  .auth-bakkah__visual-title {
    font-size: clamp(22px, 5vw, 30px);
    max-width: none;
  }
}

@media (max-width: 480px) {
  .auth-bakkah--register .auth-bakkah__visual {
    display: none !important;
  }

  .auth-bakkah--register .auth-bakkah__form-side {
    order: 1 !important;
    max-height: none;
    overflow: visible;
    padding: max(10px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
  }

  .auth-bakkah__form-inner--wide {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .auth-bakkah__form-side {
    padding: 20px 16px 32px;
  }

  .auth-bakkah__topbar {
    margin-bottom: 16px;
  }
}

@media (max-width: 820px) {
  .auth-bakkah,
  html[dir="rtl"] .auth-bakkah,
  html[dir="ltr"] .auth-bakkah,
  html[dir="rtl"] .auth-bakkah--register,
  html[dir="ltr"] .auth-bakkah--register {
    grid-template-columns: 1fr !important;
  }

  html[dir="rtl"] .auth-bakkah__form-side,
  html[dir="ltr"] .auth-bakkah__form-side {
    order: 1 !important;
    width: 100%;
    max-width: 100%;
  }
}
