/* ==========================================
   Auth Pages Stylesheet (Custom Pure CSS)
   Breakpoint: Desktop >= 768px, Mobile < 768px
   ========================================== */

/* Typography & Reset Defaults */
html {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

/* Common Backgrounds */
.bg-auth-form-bg {
  background-image: linear-gradient(225deg, #FFFFFF 0%, #FEFDFC 20%, #FCFBF9 40%, #FBF9F6 60%, #F9F7F3 80%, #F8F5F0 100%);
}

.bg-forgot-form-bg {
  background-image: linear-gradient(45deg, #F8F5F0 0%, #F9F7F3 20%, #FBF9F6 40%, #FCFBF9 60%, #FEFDFC 80%, #FFFFFF 100%);
}

.bg-forest {
  background-color: #1B4D3E !important;
}

.bg-register-panel {
  background-image: linear-gradient(225deg, #B8935A 0%, #B48F57 7.14%, #B08B53 14.29%, #AB8850 21.43%, #A7844D 28.57%, #A3804A 35.71%, #9F7D46 42.86%, #9B7943 50%, #8A7343 57.14%, #796D43 64.29%, #686743 71.43%, #576142 78.57%, #455A41 85.71%, #325440 92.86%, #1B4D3E 100%);
}

.bg-gold-gradient {
  background-image: linear-gradient(270deg, #B8935A 0%, #B48F57 7.14%, #B08B53 14.29%, #AB8850 21.43%, #A7844D 28.57%, #A3804A 35.71%, #9F7D46 42.86%, #9B7943 50%, #9F7D46 57.14%, #A3804A 64.29%, #A7844D 71.43%, #AB8850 78.57%, #B08B53 85.71%, #B48F57 92.86%, #B8935A 100%);
}

.text-gold {
  color: #B8935A;
}

/* Main Container Grid & Structure */
.auth-body {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  color: #1B4D3E;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: #F8F5F0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Styles (Hidden on mobile < 768px) */
.auth-sidebar {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: center;
  order: 2;
  padding: 24px;
  box-sizing: border-box;
}

.sidebar-content {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.sidebar-content.max-w-420 {
  max-width: 420px;
}

.sidebar-content.max-w-624 {
  max-width: 624px;
}

.sidebar-icon-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.icon-ellipse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.05);
}

.icon-svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.sidebar-logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.sidebar-title {
  color: #ffffff;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.4;
  margin-top: 0;
  margin-bottom: 12px;
}

.sidebar-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-top: 0;
  margin-bottom: 24px;
}

/* Sidebar Cards Stack styling */
.sidebar-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.sidebar-card {
  box-shadow: 0px 1px 6px 0px #00000059;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 12px;
  border: 1.27px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  padding: 14px;
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.sidebar-card-icon-container {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: #B8935A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-card-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B8935A;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

.bg-forest .sidebar-card-icon-container {
  background-color: rgba(184, 147, 90, 0.25);
}

.sidebar-card-icon-container img,
.sidebar-card-icon-container svg {
  width: 24px;
  height: 24px;
}

.sidebar-card-content {
  flex: 1;
  min-width: 0;
}

html[dir="rtl"] .sidebar-card-content {
  text-align: right;
}

html[dir="ltr"] .sidebar-card-content {
  text-align: left;
}

.sidebar-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 2px 0;
}

.sidebar-card-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  line-height: 1.5;
  font-weight: 300;
}

/* Quote Sidebar Card */
.sidebar-quote-card {
  margin-top: 24px;
  border-radius: 12px;
  border: 1.27px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.15);
  padding: 16px;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  box-shadow: 0px 1px 6px 0px #00000059;
}

.quote-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quote-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.quote-author-info {
  flex: 1;
  min-width: 0;
}

html[dir="rtl"] .quote-author-info {
  text-align: right;
}
html[dir="ltr"] .quote-author-info {
  text-align: left;
}

.quote-author-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.quote-author-title {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.2;
}

.quote-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

html[dir="rtl"] .quote-text {
  text-align: right;
}
html[dir="ltr"] .quote-text {
  text-align: left;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
  margin-top: 16px;
}

.sidebar-footer-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 12px 0;
  text-align: center;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 12px;
  text-decoration: none;
  background-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

.help-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.help-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Main Content Area */
.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 24px 16px;
  background-color: #F8F5F0;
  min-height: 100vh;
  order: 1;
  overflow-y: auto;
  box-sizing: border-box;
}

.top-utilities-bar {
  width: 100%;
  max-width: 448px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  margin-bottom: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(27, 77, 62, 0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #B8935A;
}

.back-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  color: rgba(27, 77, 62, 0.7);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(27, 77, 62, 0.2);
  border-radius: 5px;
  font-weight: 600;
  font-size: 12px;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lang-btn:hover {
  color: #B8935A;
}

.main-content-inner {
  width: 100%;
  max-width: 448px;
  margin: auto 0;
  box-sizing: border-box;
}

/* Logos on Form Area */
.form-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.form-logo-img {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.mobile-sub-title {
  display: block;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 24px;
  color: #B8935A;
}

.form-header-text {
  text-align: center;
  margin-bottom: 24px;
}

.form-title {
  font-size: 30px;
  line-height: 36px;
  font-weight: 400;
  color: #1B4D3E;
  margin: 0 0 4px 0;
  text-align: center;
}

.form-subtitle {
  font-size: 14px;
  color: rgba(27, 77, 62, 0.55);
  margin: 0;
  text-align: center;
}

/* Form Card */
.form-card {
  width: 100%;
  border-radius: 16px;
  border: 1.27px solid rgba(184, 147, 90, 0.3);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 24px 32px 16px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.gap-1 {
  gap: 4px;
}

.form-group.gap-2 {
  gap: 8px;
}

html[dir="rtl"] .form-group {
  text-align: right;
}
html[dir="ltr"] .form-group {
  text-align: left;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(27, 77, 62, 0.8);
  margin-bottom: 4px;
}

.input-relative {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
  pointer-events: none;
  display: flex;
  align-items: center;
}

html[dir="rtl"] .input-icon {
  right: 16px;
  left: auto;
}
html[dir="ltr"] .input-icon {
  left: 16px;
  right: auto;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.form-input {
  width: 100%;
  min-width: 0;
  height: 50.5px;
  padding-top: 12px;
  padding-bottom: 12px;
  box-sizing: border-box;
  font-size: 16px;
  color: #1B4D3E;
  border: 1.27px solid #E0D8CC;
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.bg-auth-cream {
  background-color: #F8F5F0;
}

.form-input:not(.bg-auth-cream) {
  background-color: #ffffff;
}

html[dir="rtl"] .form-input {
  padding-right: 48px;
  padding-left: 16px;
}

html[dir="ltr"] .form-input {
  padding-left: 48px;
  padding-right: 16px;
}

/* Password input specific padding */
html[dir="rtl"] .form-input[type="password"],
html[dir="rtl"] .form-input[type="text"].password-field {
  padding-right: 48px;
  padding-left: 48px;
}

html[dir="ltr"] .form-input[type="password"],
html[dir="ltr"] .form-input[type="text"].password-field {
  padding-left: 48px;
  padding-right: 48px;
}

.form-input:focus {
  border-color: #B8935A;
  box-shadow: 0 0 0 3px rgba(184, 147, 90, 0.1);
}

.form-input.is-invalid {
  border-color: #ef4444 !important;
}

.form-input::placeholder {
  color: rgba(27, 77, 62, 0.3);
}

/* Toggle password visual element */
.toggle-password-btn,
.toggle-password {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px;
  color: #9CA3AF;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.toggle-password-btn:hover,
.toggle-password:hover {
  color: #B8935A;
}

html[dir="rtl"] .toggle-password-btn,
html[dir="rtl"] .toggle-password {
  left: 14px;
  right: auto;
}
html[dir="ltr"] .toggle-password-btn,
html[dir="ltr"] .toggle-password {
  right: 14px;
  left: auto;
}

.toggle-password-btn svg,
.toggle-password svg {
  width: 18px;
  height: 18px;
}

.toggle-password-btn .hidden,
.toggle-password .hidden {
  display: none !important;
}

.error-message {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
}

/* Actions block */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #D0D0D0;
  accent-color: #1B4D3E;
  cursor: pointer;
  margin: 0;
}

.checkbox-text {
  font-size: 13px;
  color: rgba(27, 77, 62, 0.6);
}

.link-gold {
  color: #B8935A;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.link-gold:hover {
  opacity: 0.75;
}

.link-muted {
  font-size: 13px;
  color: rgba(27, 77, 62, 0.5);
  text-decoration: none;
  transition: color 0.15s ease;
}

.link-muted:hover {
  color: #B8935A;
}

/* Action Buttons */
.btn-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px !important;
  padding: 10px 16px !important;
  border-radius: 12px;
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  box-sizing: border-box;
}

.btn-submit.bg-forest {
  background-color: #1B4D3E;
}

.btn-submit.bg-forest:hover {
  background-color: #295F4D;
}

.btn-submit.bg-gold-gradient {
  background-image: linear-gradient(270deg, #B8935A 0%, #B48F57 7.14%, #B08B53 14.29%, #AB8850 21.43%, #A7844D 28.57%, #A3804A 35.71%, #9F7D46 42.86%, #9B7943 50%, #9F7D46 57.14%, #A3804A 64.29%, #A7844D 71.43%, #AB8850 78.57%, #B08B53 85.71%, #B48F57 92.86%, #B8935A 100%);
}

.btn-submit.bg-gold-gradient:hover {
  opacity: 0.9;
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Google Sign-in Buttons */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  color: #1B4D3E;
  background-color: #ffffff;
  border: 1.27px solid #E0D8CC;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.btn-google:hover {
  background-color: rgba(27, 77, 62, 0.05);
}

.btn-google:active {
  background-color: rgba(27, 77, 62, 0.1);
}

.btn-google svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Divider styling */
.form-separator {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
  user-select: none;
}

.form-separator-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #E0D8CC;
}

.form-separator-text {
  position: relative;
  z-index: 2;
  padding: 0 12px;
  background-color: #FFFFFF;
  font-size: 12px;
  color: rgba(27, 77, 62, 0.4);
}

.auth-switch-text {
  font-size: 14px;
  font-weight: 400;
  color: rgba(27, 77, 62, 0.55);
  text-align: center;
  padding-top: 4px;
  padding-bottom: 8px;
  margin: 0;
}

/* Country Selector Columns */
.form-select {
  width: 100%;
  min-width: 0;
  height: 50.5px;
  padding-top: 12px;
  padding-bottom: 12px;
  box-sizing: border-box;
  font-size: 16px;
  color: #1B4D3E;
  background-color: #ffffff;
  border: 1.27px solid #E0D8CC;
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  appearance: none;
  cursor: pointer;
}

html[dir="rtl"] .form-select {
  padding-right: 36px;
  padding-left: 28px;
}
html[dir="ltr"] .form-select {
  padding-left: 36px;
  padding-right: 28px;
}

.form-select:focus {
  border-color: #B8935A;
  box-shadow: 0 0 0 3px rgba(184, 147, 90, 0.1);
}

.form-select-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
  pointer-events: none;
  display: flex;
  align-items: center;
}

html[dir="rtl"] .form-select-icon {
  left: 12px;
  right: auto;
}
html[dir="ltr"] .form-select-icon {
  right: 12px;
  left: auto;
}

.form-select-icon svg {
  width: 14px;
  height: 14px;
}

.flex-row-gap-3 {
  display: flex;
  gap: 14px;
  width: 100%;
}

.country-col {
  width: 140px;
  flex-shrink: 0;
}

.phone-col {
  flex: 1;
  min-width: 0;
}

/* Mobile top banner */
.mobile-top-banner {
  display: block;
  width: calc(100% + 32px); /* breakout of main padding */
  margin-left: -16px;
  margin-right: -16px;
  margin-top: -24px;
  padding: 24px 20px;
  text-align: center;
  background-color: #1B4D3E;
  color: #ffffff;
  box-sizing: border-box;
  margin-bottom: 24px;
}

.mobile-top-banner.bg-register {
  background-image: linear-gradient(225deg, #B8935A 0%, #B48F57 7.14%, #B08B53 14.29%, #AB8850 21.43%, #A7844D 28.57%, #A3804A 35.71%, #9F7D46 42.86%, #9B7943 50%, #8A7343 57.14%, #796D43 64.29%, #686743 71.43%, #576142 78.57%, #455A41 85.71%, #325440 92.86%, #1B4D3E 100%);
}

.mobile-banner-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.mobile-banner-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.mobile-banner-title {
  font-size: 24px;
  line-height: 1.4;
  font-weight: 400;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.mobile-banner-desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

/* Small Screens Adjustments (<480px) */
@media (max-width: 480px) {
  .form-card {
    padding: 20px 20px 12px 20px;
  }
  .form-title {
    font-size: 26px;
    line-height: 32px;
  }
  .form-select-icon {
    font-size: 11px;
  }
}

/* ==========================================
   Media Query for Large Screens (>= 768px)
   ========================================== */
@media (min-width: 768px) {
  .auth-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-sidebar {
    display: flex;
    order: 1;
    padding: 20px;
    min-height: 100vh;
    height: 100%;
  }

  .auth-main {
    order: 2;
    padding: 32px 20px;
    height: 100%;
    min-height: 100vh;
  }

  .mobile-top-banner {
    display: none;
  }

  .mobile-sub-title {
    display: none;
  }

  .form-logo-container {
    margin-bottom: 32px;
  }

  .form-logo-img {
    height: 64px;
  }

  /* Specific sidebar sizing updates */
  .sidebar-title {
    font-size: 28px;
    margin-bottom: 12px;
  }

  .sidebar-desc {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .form-title {
    font-size: 30px;
    margin-bottom: 4px;
  }

  .form-input {
    font-size: 14px;
  }
  
  .form-select {
    font-size: 12px;
  }

  /* Quote sidebar height and spacings */
  .sidebar-quote-card {
    margin-top: 32px;
    padding: 20px;
  }
}
