/**
 * بوابة الشكاوى — شريط علوي + صفحة الدخول
 * v=1
 */
body.cx-complaints-portal {
  background: #f4f7fa;
  color: var(--jia-pub-ink, #163247);
}

body.cx-complaints-portal #main {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem) 1rem 2rem;
}

/* —— الشريط العلوي —— */
.cx-portal-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  border-bottom: 1px solid rgba(15, 77, 112, 0.1);
}

.cx-portal-header__inner {
  max-width: var(--jia-pub-container, 1180px);
  margin-inline: auto;
  padding: 0.45rem clamp(0.85rem, 3vw, 1.1rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

@media (min-width: 992px) {
  .cx-portal-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }

  .cx-portal-header__brand {
    justify-self: start;
  }

  .cx-portal-header__collapse {
    justify-self: center;
  }

  .cx-portal-header__actions {
    justify-self: end;
    grid-column: 3;
  }
}

.cx-portal-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.cx-portal-header__brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.cx-portal-header__title {
  display: none;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--jia-pub-brand-deep, #062436);
  max-width: 14rem;
}

@media (min-width: 768px) {
  .cx-portal-header__title {
    display: block;
  }
}

.cx-portal-header__toggle {
  margin-inline-start: auto;
  border: 1px solid var(--jia-pub-line);
  background: #fff;
  color: var(--jia-pub-brand, #0a4d6e);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) {
  .cx-portal-header__toggle {
    display: none;
  }
}

.cx-portal-header__collapse {
  flex: 1 1 100%;
}

@media (min-width: 992px) {
  .cx-portal-header__collapse {
    flex: none;
    display: flex !important;
    justify-content: center;
    grid-column: 2;
  }
}

.cx-portal-header__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0.25rem;
}

@media (min-width: 992px) {
  .cx-portal-header__nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.15rem 0.35rem;
    padding: 0;
  }
}

.cx-portal-header__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none !important;
  color: var(--jia-pub-ink, #163247) !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.cx-portal-header__link:hover,
.cx-portal-header__link:focus-visible {
  background: var(--jia-pub-brand-soft, #e8f3f8);
  color: var(--jia-pub-brand, #0a4d6e) !important;
}

.cx-portal-header__link.is-active {
  color: var(--jia-pub-brand, #0a4d6e) !important;
  font-weight: 600;
  background: rgba(10, 77, 110, 0.08);
}

.cx-portal-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}

@media (max-width: 991.98px) {
  .cx-portal-header__actions {
    margin-inline-start: 0;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: 0.35rem;
  }
}

.cx-portal-header__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--jia-pub-brand, #0a4d6e);
  color: #fff;
  box-shadow: 0 6px 14px rgba(10, 77, 110, 0.25);
  transition: transform 0.15s ease, background 0.2s ease;
}

.cx-portal-header__logout:hover {
  background: var(--jia-pub-brand-deep, #062436);
  transform: translateY(-1px);
}

/* إلغاء زخارف styley على شريط الشكاوى */
.cx-portal-header .navbar-nav,
.cx-portal-header .nav-item::before,
.cx-portal-header .nav-item::after {
  display: none !important;
}

/* —— صفحة الدخول —— */
body.cx-complaints-portal .cx-login-shell {
  width: min(420px, 100%);
}

.cx-login-card {
  background: #fff;
  border: 1px solid rgba(15, 77, 110, 0.12);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(6, 36, 54, 0.06);
  overflow: hidden;
}

.cx-login-card__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(15, 77, 112, 0.08);
  background: linear-gradient(180deg, #f8fbfd 0%, #fff 100%);
}

.cx-login-card__logo {
  flex-shrink: 0;
  border-radius: 10px;
}

.cx-login-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--jia-pub-brand-deep, #062436);
  line-height: 1.35;
}

.cx-login-card__sub {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--jia-pub-muted, #5f7383);
}

.cx-login-card__hint {
  margin: 0;
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--jia-pub-brand-deep);
  background: var(--jia-pub-brand-soft, #e8f3f8);
  border-bottom: 1px solid rgba(15, 77, 112, 0.06);
}

.cx-login-form {
  padding: 1.15rem 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cx-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cx-field__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--jia-pub-muted, #5f7383);
}

.cx-field__box {
  position: relative;
  display: flex;
  align-items: center;
}

.cx-field__input {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 2.5rem 0.5rem 0.85rem;
  border: 1px solid rgba(15, 77, 112, 0.16);
  border-radius: 10px;
  font-size: 0.92rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cx-field__input:focus {
  outline: none;
  border-color: var(--jia-pub-brand, #0a4d6e);
  box-shadow: 0 0 0 3px rgba(10, 77, 110, 0.12);
}

.cx-field__icon {
  position: absolute;
  inset-inline-start: 0.75rem;
  font-size: 0.9rem;
  color: var(--jia-pub-muted);
  pointer-events: none;
}

.cx-field__icon-btn {
  position: absolute;
  inset-inline-start: 0.35rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--jia-pub-muted);
  cursor: pointer;
}

.cx-field__icon-btn:hover {
  color: var(--jia-pub-brand);
  background: rgba(10, 77, 110, 0.06);
}

.cx-field__error {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.78rem;
  color: var(--cx-danger, #b42318);
}

.cx-captcha--stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cx-captcha__media {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.cx-captcha__media img {
  flex: 1 1 auto;
  display: block;
  min-height: 52px;
  max-height: 56px;
  width: 100%;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(15, 77, 112, 0.14);
  background: #f8fafb;
  cursor: pointer;
}

.cx-captcha__refresh {
  flex: 0 0 48px;
  width: 48px;
  min-height: 52px;
  border: 1px solid rgba(15, 77, 112, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--jia-pub-brand);
  cursor: pointer;
}

.cx-captcha__input {
  min-height: 46px;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(15, 77, 112, 0.16);
  border-radius: 10px;
  font-size: 0.92rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.cx-captcha__input:focus {
  outline: none;
  border-color: var(--jia-pub-brand);
  box-shadow: 0 0 0 3px rgba(10, 77, 110, 0.12);
}

.cx-login-form__submit {
  width: 100%;
  min-height: 50px;
  margin-top: 0.35rem;
  border: none;
  border-radius: 10px;
  background: var(--jia-pub-brand-deep, #062436);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(6, 36, 54, 0.18);
}

.cx-login-form__submit:hover {
  background: var(--jia-pub-brand, #0a4d6e);
}

.cx-login-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  padding: 1rem 1.25rem 1.2rem;
  border-top: 1px solid rgba(15, 77, 112, 0.08);
}

.cx-login-card__foot-label {
  font-size: 0.82rem;
  color: var(--jia-pub-muted);
}

.cx-login-card__register {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--jia-pub-brand);
  text-decoration: none;
}

.cx-login-card__register:hover {
  text-decoration: underline;
}