/* Base layout */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.auth-wrapper {
  width: 100%;
}

.auth-part {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Position classes */
.position-arabic .auth-wrapper,
.position-english .auth-wrapper {
  transform: none;
}

.position-english .auth-form {
  order: -1;
}

/* Banner & form */
.auth-banner,
.auth-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
}

.auth-banner-overlay {
  text-align: center;
  padding: 20px;
  width: 100%;
}

/* Form content */
.auth-form-content {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  max-height: 100vh;
  overflow-y: auto;
  text-align: left;
}

html[dir="rtl"] .auth-form-content {
  text-align: right;
}

/* Headings and helpers */
.login-instruction {
  font-size: 14px;
  color: #333;
  margin-bottom: 10px;
  font-weight: bold;
}

/* Continue list (SSO) */
.auth-form-continue {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-form-continue li {
  margin-bottom: 10px;
}

.auth-form-continue a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px;
  border-radius: 5px;
  color: #fff;
  font-weight: 500;
  width: 100%;
}

.auth-form-continue a.google {
  background-color: #8f0f03;
}

.auth-form-continue a img.google-logo {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 10px;
  margin-left: 0;
}

html[dir="rtl"] .auth-form-continue a img.google-logo {
  margin-right: 0;
  margin-left: 10px;
}

/* Tabs */
.login-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-direction: row;
}

html[dir="rtl"] .login-tabs {
  flex-direction: row-reverse;
}

.login-tab {
  flex: 1;
  padding: 8px 15px;
  text-align: center;
  border-radius: 20px;
  background-color: #e0e0e0;
  color: #666;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  z-index: 1;
}

.login-tab.active {
  background-color: rgba(10, 9, 48, 0.9);
  color: #fff;
}

.login-tab:hover:not(.active) {
  background-color: #d0d0d0;
}

/* Form groups */
.form-group {
  margin-bottom: 15px;
}

/* Inputs visibility */
#email_input,
.phone-input-wrap {
  display: none;
}

#email_input.active,
.phone-input-wrap.active {
  display: block;
}

/* General inputs */
#email_input,
.form-control[type="password"] {
  width: 100%;
  height: 48px;
  border: 1px solid #d8dce7;
  border-radius: 12px;
  padding: 0 14px;
  box-sizing: border-box;
}

#email_input {
  text-align: left;
  direction: ltr;
}

.form-control[type="password"] {
  text-align: left;
}

html[dir="rtl"] #email_input,
html[dir="rtl"] .form-control[type="password"] {
  text-align: right;
}

/* Remember / forgot row */
.form-group-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
}

html[dir="rtl"] .form-group-content {
  flex-direction: row-reverse;
}

.form-check-label {
  margin-left: 10px;
}

html[dir="rtl"] .form-check {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
}

html[dir="rtl"] .form-check-input {
  margin: 0;
}

html[dir="rtl"] .form-check-label {
  margin: 0 8px 0 0;
}

.auth-forgot {
  text-align: right;
}

html[dir="rtl"] .auth-forgot {
  text-align: left;
}

/* Submit + bottom text */
.form-btn {
  width: 100%;
  text-align: center;
}

.auth-form-text {
  text-align: center;
  direction: ltr;
}

html[dir="rtl"] .auth-form-text {
  text-align: right;
  direction: rtl;
}

/* Language toggler */
.language-toggler {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
  flex-direction: row;
}

html[dir="rtl"] .language-toggler {
  left: auto;
  right: 20px;
  flex-direction: row-reverse;
}

.language-toggler a {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 0;
  padding: 0;
}

.language-toggler a.active {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.language-toggler a:hover {
  transform: scale(1.1);
}

.language-toggler .flag-icon {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: block;
}

/* Logo */
.auth-logo img {
  height: 110px;
  width: auto;
}

.auth-logo .logo-container {
  height: 110px;
  width: 110px;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.auth-logo .logo-container:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.auth-logo .logo-container img {
  height: 75%;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.auth-logo .logo-container:hover img {
  transform: rotate(3deg);
}

/* =========================
   Phone input
   ========================= */

.phone-input-wrap,
.phone-input-wrap .iti {
  width: 100%;
}

.phone-input-wrap {
  display: none;
}

.phone-input-wrap.active {
  display: block;
}

.phone-input-wrap .iti {
  display: block;
  direction: ltr;
}

.phone-input-wrap #phone_input {
  width: 100% !important;
  height: 48px;
  border: 1px solid #d8dce7;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 16px;
  padding-left: 90px !important;
  padding-right: 14px !important;
  box-sizing: border-box;
  text-align: left !important;
  direction: ltr !important;
}

.phone-input-wrap .iti__flag-container {
  left: 0 !important;
  right: auto !important;
}

.phone-input-wrap .iti__selected-flag {
  height: 48px;
  padding: 0 12px;
  background: #f3f4f6;
  border-right: 1px solid #e5e7eb;
  border-radius: 12px 0 0 12px;
}

.phone-input-wrap .iti__selected-dial-code {
  font-size: 15px;
  color: #475569;
  font-weight: 600;
}

.phone-input-wrap .iti__arrow {
  margin-left: 6px;
}

/* dropdown */
.iti__country-list {
  width: 360px !important;
  max-width: 90vw !important;
  max-height: 260px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16) !important;
  padding: 6px 0 !important;
  margin-top: 8px !important;
  z-index: 99999 !important;
  direction: ltr !important;
  text-align: left !important;
}

.iti__search-input {
  width: calc(100% - 24px) !important;
  height: 40px !important;
  margin: 8px 12px 10px !important;
  padding: 0 12px !important;
  border: 1px solid #dbe2ea !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  outline: none !important;
  box-sizing: border-box !important;
  direction: ltr !important;
  text-align: left !important;
}

.iti__country {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 14px !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  direction: ltr !important;
  text-align: left !important;
}

.iti__country:hover {
  background: #f8fbff !important;
}

.iti__highlight {
  background: #eef4ff !important;
}

.iti__flag-box {
  margin-right: 8px !important;
  margin-left: 0 !important;
}

.iti__country-name {
  color: #334155 !important;
  font-weight: 500 !important;
}

.iti__dial-code {
  color: #94a3b8 !important;
  margin-left: auto !important;
  margin-right: 0 !important;
}

.iti__country-list::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.iti__country-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}

.iti__country-list::-webkit-scrollbar-track {
  background: #f1f5f9;
}

/* Syria flag override */
.iti__flag.iti__sy {
  background-image: url('/website/images/flag/ar.png') !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}

/* RTL page fix */
html[dir="rtl"] .phone-input-wrap .iti,
html[dir="rtl"] .phone-input-wrap #phone_input {
  direction: ltr !important;
  text-align: left !important;
}

html[dir="rtl"] .iti__country-list,
html[dir="rtl"] .iti-list-rtl-fix {
  direction: ltr !important;
  text-align: left !important;
  left: 0 !important;
  right: auto !important;
  transform: none !important;
}

html[dir="rtl"] .iti__search-input {
  direction: ltr !important;
  text-align: left !important;
}

html[dir="rtl"] .iti__country {
  direction: ltr !important;
  text-align: left !important;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-banner {
    display: none;
  }

  .auth-form {
    flex: none;
    width: 100%;
    height: 100vh;
  }

  .auth-part {
    width: 100%;
  }

  .auth-wrapper {
    width: 100%;
    transform: none !important;
  }

  .language-toggler {
    position: fixed;
    left: 20px;
  }

  html[dir="rtl"] .language-toggler {
    left: auto;
    right: 20px;
  }
}

@media (max-width: 576px) {
  .auth-form-content {
    padding: 15px;
    max-width: 100%;
  }

  .login-tab {
    font-size: 12px;
    padding: 6px 10px;
  }

  .auth-form-title {
    font-size: 20px;
  }

  .login-instruction {
    font-size: 12px;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .auth-logo .logo-container {
    height: 90px;
    width: 90px;
  }

  .auth-logo img {
    height: 90px;
  }

  .iti__country-list {
    width: 92vw !important;
    max-width: 92vw !important;
  }
}