/* ========== Auth pages (login / signup / reset) ========== */
.auth-page {
  background: var(--page-bg);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

/* Brand side: reuses the home hero media (fallback image + overlay) */
.auth-visual {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 3rem;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.auth-visual .top-hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(4, 18, 36, 0.45) 0%,
    rgba(4, 18, 36, 0.15) 40%,
    rgba(4, 18, 36, 0.88) 100%
  );
}

.auth-visual-body {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.auth-visual .brand-logo img {
  width: 56px;
  height: auto;
}

.auth-visual-copy {
  max-width: 30rem;
}

.auth-visual-title {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.auth-visual-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-points i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--adnoc-yellow);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Form side */
.auth-panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 1.5rem 3rem;
  background: #fff;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.auth-back:hover {
  color: var(--adnoc-blue);
}

[dir="rtl"] .auth-back .bi-arrow-left {
  transform: scaleX(-1);
}

.auth-mobile-logo {
  display: none;
}

.auth-mobile-logo img {
  width: 44px;
  height: auto;
}

.auth-form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 2.5rem 0;
}

.auth-form-inner {
  width: 100%;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--adnoc-blue);
  background: rgba(0, 87, 160, 0.08);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  margin-bottom: 1rem;
}

[dir="rtl"] .auth-eyebrow {
  letter-spacing: 0;
}

.auth-title {
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--adnoc-navy);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 2rem;
}

.auth-form .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.auth-field {
  position: relative;
}

.auth-field > .bi {
  position: absolute;
  top: 0;
  inset-inline-start: 1rem;
  height: 50px;
  display: flex;
  align-items: center;
  color: #8a9aab;
  font-size: 1.05rem;
  pointer-events: none;
  z-index: 4;
}

.auth-form .form-control,
.auth-form .form-select,
.auth-form .input-group-text {
  min-height: 50px;
  border-radius: 0.8rem;
  border: 1px solid #d5dde6;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.auth-form .form-control {
  padding-inline: 1rem;
}

.auth-field > .bi ~ .form-control {
  padding-inline-start: 2.75rem;
}

/* LTR inputs (email, phone) on Arabic pages: keep the icon gap on the icon's side */
[dir="rtl"] .auth-field .form-control[dir="ltr"],
[dir="rtl"] .auth-field .form-control[dir="auto"] {
  text-align: right;
}

/* Phone group stays LTR (+971 first) inside the RTL Bootstrap build */
[dir="rtl"] .auth-form .input-group[dir="ltr"] > .input-group-text {
  border-radius: 0.8rem 0 0 0.8rem !important;
}

[dir="rtl"] .auth-form .input-group[dir="ltr"] > .form-control {
  border-radius: 0 0.8rem 0.8rem 0 !important;
  margin-right: 0 !important;
  margin-left: -1px !important;
}

[dir="rtl"] .auth-field > .bi ~ .form-control[dir="ltr"],
[dir="rtl"] .auth-field > .bi ~ .form-control[dir="auto"] {
  padding-left: 1rem;
  padding-right: 2.75rem;
}

.auth-field .form-control.has-toggle {
  padding-inline-end: 3rem;
}

.auth-form .form-control::placeholder {
  color: #9aa8b6;
}

.auth-form .form-control:focus {
  border-color: var(--adnoc-blue);
  box-shadow: 0 0 0 0.25rem rgba(0, 87, 160, 0.14);
}

.auth-form .input-group-text {
  background: var(--page-bg);
  font-weight: 600;
  color: var(--text-muted);
}

/* Validation: red border + message only; no green "valid" state, no inline icons */
.auth-form.was-validated .form-control:valid {
  border-color: #d5dde6;
  background-image: none;
}

.auth-form.was-validated .form-control:valid:focus {
  border-color: var(--adnoc-blue);
  box-shadow: 0 0 0 0.25rem rgba(0, 87, 160, 0.14);
}

.auth-form.was-validated .form-control:invalid {
  background-image: none;
}

.auth-form.was-validated .mb-3:has(.form-control:invalid) > .form-text {
  display: none;
}

.auth-form.was-validated .form-check-input:valid {
  border-color: #b9c6d3;
}

.auth-form.was-validated .form-check-input:valid:checked {
  background-color: var(--adnoc-blue);
  border-color: var(--adnoc-blue);
}

.auth-form.was-validated .form-check-input:valid ~ .form-check-label {
  color: var(--text-muted);
}

.auth-form .invalid-feedback {
  font-size: 0.8rem;
}

.auth-form .form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.password-toggle {
  position: absolute;
  top: 0;
  inset-inline-end: 0.35rem;
  height: 50px;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #8a9aab;
  font-size: 1.1rem;
  border-radius: 0.6rem;
  z-index: 4;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--adnoc-blue);
}

.auth-form .form-check-input {
  width: 1.1em;
  height: 1.1em;
  border-color: #b9c6d3;
}

.auth-form .form-check-input:checked {
  background-color: var(--adnoc-blue);
  border-color: var(--adnoc-blue);
}

.auth-form .form-check-label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-link {
  color: var(--adnoc-blue);
  font-weight: 600;
}

.auth-link:hover {
  color: var(--adnoc-blue-dark);
  text-decoration: underline;
}

.btn-auth {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 999px;
  background: var(--adnoc-blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 87, 160, 0.3);
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-auth:hover,
.btn-auth:focus {
  background: #1a7fc4;
  color: #fff;
  transform: translateY(-1px);
}

[dir="rtl"] .btn-auth .bi-arrow-right {
  transform: scaleX(-1);
}

.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 1.75rem 0 0;
}

.auth-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  font-size: 0.78rem;
  color: #8a9aab;
}

.auth-legal a {
  color: inherit;
}

.auth-legal a:hover {
  color: var(--adnoc-blue);
}

/* Reset: "check your email" state */
.auth-success {
  text-align: center;
}

.auth-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  font-size: 2rem;
  color: var(--adnoc-blue);
  background: rgba(0, 87, 160, 0.08);
  margin-bottom: 1.5rem;
}

.auth-success .auth-subtitle strong {
  color: var(--text-dark);
  overflow-wrap: anywhere;
  unicode-bidi: isolate;
}

.auth-success .auth-title:focus {
  outline: none;
}

@media (max-width: 1199.98px) {
  .auth-visual,
  .auth-panel {
    padding-inline: 2rem;
  }
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-mobile-logo {
    display: inline-flex;
  }

  .auth-panel {
    padding: 1.25rem 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .auth-panel {
    padding: 1rem;
  }

  .auth-form-wrap {
    padding: 2rem 0;
  }

  .auth-back span {
    display: none;
  }
}

/* ========== UAE PASS ========== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.15rem 0;
  color: #8a9aab;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #dce3ea;
}

.btn-uaepass {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c8d2dc;
  border-radius: 999px;
  background: #fff;
  color: #0b2c4d;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  box-shadow: 0 4px 14px rgba(15, 35, 60, 0.06);
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-uaepass img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.btn-uaepass:hover,
.btn-uaepass:focus {
  border-color: #00a651;
  color: #0b2c4d;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 166, 81, 0.12);
}

/* ========== Multi-step registration ========== */
.auth-shell-register .auth-panel {
  background: #eef2f6;
}

.auth-form-wrap-wide {
  max-width: 920px;
  align-items: stretch;
}

.register-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.register-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0;
  background: #fff;
  border-radius: 1.15rem;
  box-shadow: 0 12px 36px rgba(15, 35, 60, 0.08);
  overflow: hidden;
  margin-top: 1.25rem;
}

.register-steps {
  padding: 1.75rem 1.25rem;
  background: #f7f9fb;
  border-inline-end: 1px solid #e6ebf0;
}

.register-step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.55rem;
  border-radius: 0.75rem;
  color: #8a9aab;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: transparent;
  width: 100%;
  text-align: start;
}

.register-step-item + .register-step-item {
  margin-top: 0.35rem;
}

.register-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
  background: #e4eaf0;
  color: #6b7c8d;
  flex-shrink: 0;
}

.register-step-item.is-active {
  background: rgba(0, 87, 160, 0.08);
  color: var(--adnoc-blue);
}

.register-step-item.is-active .register-step-num {
  background: var(--adnoc-blue);
  color: #fff;
}

.register-step-item.is-done {
  color: var(--adnoc-navy);
}

.register-step-item.is-done .register-step-num {
  background: #d9f0e3;
  color: #00a651;
}

.register-body {
  padding: 1.75rem 1.75rem 1.5rem;
}

.register-panel[hidden] {
  display: none !important;
}

.register-panel .form-control,
.register-panel .form-select {
  background: #f3f6f9;
  border-color: transparent;
}

.register-panel .form-control:focus,
.register-panel .form-select:focus {
  background: #fff;
}

.client-type-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.35rem;
}

.client-type-group .form-check-label {
  color: var(--text-dark);
  font-weight: 500;
}

.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  border-radius: 0.8rem;
  background: #f3f6f9;
}

.upload-row-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dark);
}

.upload-row .btn-upload {
  border: none;
  border-radius: 0.65rem;
  background: #dcecf8;
  color: var(--adnoc-blue);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}

.upload-row .btn-upload:hover,
.upload-row .btn-upload:focus {
  background: #c7e2f5;
  color: var(--adnoc-blue-dark);
}

.upload-row .upload-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-inline-start: auto;
  margin-inline-end: 0.5rem;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.register-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e6ebf0;
}

.btn-auth-outline {
  min-height: 48px;
  border: 1px solid #c8d2dc;
  border-radius: 999px;
  background: #fff;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-auth-outline:hover,
.btn-auth-outline:focus {
  border-color: var(--adnoc-blue);
  color: var(--adnoc-blue);
  background: #fff;
}

.register-actions .btn-auth {
  width: auto;
  min-width: 150px;
  min-height: 48px;
  padding: 0.55rem 1.5rem;
}

@media (max-width: 991.98px) {
  .auth-shell-register {
    grid-template-columns: 1fr;
  }

  .register-card {
    grid-template-columns: 1fr;
  }

  .register-steps {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    border-inline-end: none;
    border-bottom: 1px solid #e6ebf0;
    padding: 1rem;
  }

  .register-step-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .register-step-item + .register-step-item {
    margin-top: 0;
  }
}

@media (max-width: 575.98px) {
  .register-body {
    padding: 1.25rem 1rem 1.15rem;
  }

  .upload-row {
    flex-wrap: wrap;
  }

  .register-actions {
    flex-direction: column-reverse;
  }

  .register-actions .btn-auth,
  .register-actions .btn-auth-outline {
    width: 100%;
    justify-content: center;
  }
}
