/**
 * Lido CRM - Modern Authentication Theme (Login & Register)
 * Designed for RTL & Responsive across Desktop, Tablet, Mobile
 * Matches reference UI: Landmark illustration background, floating right card,
 * teal primary accent, rounded controls, custom icons, fixed sharp background.
 */

:root {
  --lido-primary: #00a88f;
  --lido-primary-hover: #00937d;
  --lido-primary-gradient: linear-gradient(135deg, #00a88f 0%, #008774 100%);
  --lido-primary-shadow: 0 10px 25px -4px rgba(0, 168, 143, 0.40);
  --lido-bg-page: #FDFCF7;
  --lido-text-main: #0f172a;
  --lido-text-sub: #64748b;
  --lido-placeholder: #94a3b8;
  --lido-border: #e2e8f0;
  --lido-border-focus: #00a88f;
  --lido-bg-card: #ffffff;
  --lido-radius-card: 32px;
  --lido-radius-input: 16px;
}

/* Page Body Base */
html,
body.login_admin.admin-auth-shell,
body.customers_login.client-auth-shell,
body.customers:has(.client-auth-root),
.login_admin.client-auth-root {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--admin-modam-font), "IRANSansAdmin", "IRANYekanX", "IRANSansX", "Inter", sans-serif;
  background-color: var(--lido-bg-page) !important;
  color: var(--lido-text-main);
  direction: rtl;
  overflow-x: hidden;
}

/* Fixed Background Layer (Keeps illustration locked, sharp, and non-scrolling) */
.lido-auth-bg-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--lido-bg-page);
  background-image: url('../images/bg-login.png');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
}

@media (min-width: 1200px) {
  .lido-auth-bg-fixed {
    background-size: contain;
    background-position: left center;
    background-color: var(--lido-bg-page);
  }
}

@media (max-width: 991px) {
  .lido-auth-bg-fixed {
    background-size: cover;
    background-position: center center;
  }
}

/* Fullscreen Auth Shell */
.lido-auth-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* In RTL, flex-start places child on the RIGHT side */
  padding: 40px clamp(20px, 6.5vw, 120px);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* Auth Card */
.lido-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--lido-bg-card);
  border-radius: var(--lido-radius-card);
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
  padding: 44px 38px 40px;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Register page card needs a bit more width for 2-column fields */
.lido-auth-card--register {
  max-width: 620px;
  padding: 40px 38px;
}

/* Brand Logo Area */
.lido-auth-brand {
  text-align: center;
  margin-bottom: 22px;
}

.lido-auth-logo {
  max-width: 170px;
  width: auto;
  height: auto;
  max-height: 68px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.lido-auth-logo-text {
  font-size: 34px;
  font-weight: 900;
  color: #00a88f;
  letter-spacing: -1px;
  line-height: 1;
}

.lido-auth-brand-sub {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--lido-text-sub);
  margin-top: 6px;
  letter-spacing: -0.2px;
}

/* Header Titles */
.lido-auth-header {
  text-align: center;
  margin-bottom: 26px;
}

.lido-auth-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--lido-text-main);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.lido-auth-subtitle {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* Language Switcher - Hidden per request */
.lido-auth-lang-switcher {
  display: none !important;
}

/* Alerts */
.lido-auth-alerts {
  margin-bottom: 20px;
}

.lido-auth-alerts .alert {
  border-radius: 14px;
  font-size: 13px;
  padding: 12px 16px;
  border: none;
  margin-bottom: 12px;
  text-align: right;
  line-height: 1.5;
}

.lido-auth-alerts .alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fee2e2;
}

.lido-auth-alerts .alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

/* Form Groups & Inputs */
.lido-form-group {
  margin-bottom: 18px;
  position: relative;
}

.lido-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.lido-input {
  width: 100% !important;
  height: 52px !important;
  background: #ffffff !important;
  border: 1.5px solid var(--lido-border) !important;
  border-radius: var(--lido-radius-input) !important;
  font-size: 14px !important;
  color: var(--lido-text-main) !important;
  /* In RTL: icon is on the left, so left padding is 48px, text starts from right (18px) */
  padding: 0 18px 0 48px !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  transition: all 0.2s ease-in-out !important;
  font-family: inherit !important;
  text-align: right;
}

/* When input has both left icon (lock) and right icon (eye toggle) */
.lido-input--with-toggle {
  padding-right: 48px !important;
  padding-left: 48px !important;
}

.lido-input::placeholder {
  color: var(--lido-placeholder) !important;
  opacity: 1 !important;
  font-size: 13.5px !important;
}

.lido-input:focus {
  border-color: var(--lido-border-focus) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(0, 168, 143, 0.12) !important;
  outline: none !important;
}

/* Field Icons (Left positioned: Lock and Person) */
.lido-field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  width: 20px;
  height: 20px;
  transition: color 0.2s ease;
  z-index: 2;
}

.lido-input:focus ~ .lido-field-icon,
.lido-input-wrap:focus-within .lido-field-icon {
  color: var(--lido-primary);
}

.lido-field-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Password Eye Toggle (Right positioned in password input) */
.lido-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  border-radius: 8px;
  z-index: 2;
}

.lido-password-toggle:hover {
  color: #475569;
}

.lido-password-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Options Row (Remember Me & Forgot Password) */
.lido-auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 13px;
}

.lido-remember-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  font-weight: 500;
  color: #475569;
}

.lido-remember-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1.8px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  margin: 0;
  position: relative;
  transition: all 0.2s ease;
  background: #ffffff;
  display: inline-block;
}

.lido-remember-wrap input[type="checkbox"]:checked {
  background-color: var(--lido-primary);
  border-color: var(--lido-primary);
}

.lido-remember-wrap input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.lido-auth-link {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  font-size: 12.5px;
  transition: color 0.2s ease;
}

.lido-auth-link:hover {
  color: var(--lido-primary);
  text-decoration: none;
}

/* Primary Submit Button ("ورود به پنل") */
.lido-btn-primary {
  width: 100% !important;
  height: 52px !important;
  background: var(--lido-primary-gradient) !important;
  border: none !important;
  border-radius: var(--lido-radius-input) !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  cursor: pointer !important;
  box-shadow: var(--lido-primary-shadow) !important;
  transition: all 0.25s ease !important;
  margin-top: 6px !important;
  text-decoration: none !important;
}

.lido-btn-primary:hover {
  background: linear-gradient(135deg, #009881 0%, #007766 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 14px 28px -4px rgba(0, 168, 143, 0.48) !important;
  color: #ffffff !important;
}

.lido-btn-primary:active {
  transform: translateY(0) !important;
}

/* Arrow inside primary button placed on the far left */
.lido-btn-primary .lido-btn-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  transition: transform 0.2s ease;
}

.lido-btn-primary:hover .lido-btn-icon {
  transform: translate(-3px, -50%);
}

/* Divider ("یا") */
.lido-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: #94a3b8;
  font-size: 12.5px;
}

.lido-auth-divider::before,
.lido-auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #edf2f7;
}

.lido-auth-divider span {
  padding: 0 14px;
  color: #94a3b8;
  font-weight: 500;
}

/* Secondary Button ("ورود با شماره موبایل") */
.lido-btn-secondary {
  width: 100% !important;
  height: 50px !important;
  background: #ffffff !important;
  border: 1.5px solid var(--lido-border) !important;
  border-radius: var(--lido-radius-input) !important;
  color: #334155 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.lido-btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  text-decoration: none !important;
}

.lido-btn-secondary svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
}

/* Suppress ugly duplicate boxes from mugmobileauth hook inside lido card */
.lido-auth-card .mugmobileauth-entry,
.lido-auth-card .mugmobileauth-entry-admin,
.lido-auth-card .mugmobileauth-entry-client {
  display: none !important;
}

/* Clean styling if mugmobileauth button is loaded standalone */
.mugmobileauth-entry__button {
  background: #ffffff !important;
  border: 1.5px solid var(--lido-border) !important;
  border-radius: var(--lido-radius-input) !important;
  box-shadow: none !important;
  color: #334155 !important;
  min-height: 50px !important;
  height: 50px !important;
  padding: 0 16px !important;
}

.mugmobileauth-entry__button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.mugmobileauth-entry__icon {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lido-primary) !important;
}

.mugmobileauth-entry__content small {
  display: none !important;
}

.mugmobileauth-entry__chevron {
  display: none !important;
}

/* Registration Link below Secondary Button */
.lido-auth-footer-link {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lido-auth-footer-link a,
.lido-auth-link--bold {
  color: var(--lido-primary);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lido-auth-footer-link a:hover,
.lido-auth-link--bold:hover {
  color: var(--lido-primary-hover);
  text-decoration: underline;
}

/* Powered by Lido Footer */
.lido-auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12.5px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: -0.2px;
}

/* ==========================================================================
   Register Page Specific Styles
   ========================================================================== */

/* Multi-step Navigation Pills */
.lido-register-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.lido-step-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s ease;
  font-family: inherit;
}

.lido-step-pill.is-active {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.lido-step-num {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.lido-step-pill.is-active .lido-step-num {
  background: var(--lido-primary);
  color: #ffffff;
}

/* Step Panels */
.client-register-panel {
  display: none;
}

.client-register-panel.is-active {
  display: block;
  animation: lidoFadeIn 0.25s ease-out;
}

@keyframes lidoFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Register Form Fields */
.lido-auth-card--register .lido-form-group label,
.lido-auth-card--register .form-group label,
.lido-auth-card--register .control-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  text-align: right;
}

.lido-auth-card--register .form-control {
  width: 100% !important;
  height: 48px !important;
  background: #ffffff !important;
  border: 1.5px solid var(--lido-border) !important;
  border-radius: 12px !important;
  font-size: 13.5px !important;
  color: var(--lido-text-main) !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  transition: all 0.2s ease-in-out !important;
  font-family: inherit !important;
  text-align: right;
}

.lido-auth-card--register .form-control:focus {
  border-color: var(--lido-border-focus) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(0, 168, 143, 0.12) !important;
  outline: none !important;
}

/* Selectpicker / Native Select in Register */
.lido-auth-card--register .bootstrap-select > .btn {
  height: 48px !important;
  border: 1.5px solid var(--lido-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  font-size: 13.5px !important;
  color: var(--lido-text-main) !important;
  box-shadow: none !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
}

.lido-auth-card--register select.form-control {
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
}

/* Two-column grid in Register */
.lido-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .lido-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Actions in Step 2: Split Back & Submit */
.lido-register-actions {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  margin-top: 20px;
}

/* Inline Errors */
.client-register-inline-error {
  margin-top: 5px;
  font-size: 12px;
  color: #dc2626;
  text-align: right;
}

.client-register-invalid,
.client-register-invalid.form-control {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

/* Honeypot hidden fields */
.honey-element {
  display: none !important;
}

/* Hide Old Complex Showcase Layout */
.login_admin .admin-auth-layout {
  display: block !important;
  min-height: 100vh !important;
}

.login_admin .admin-auth-showcase {
  display: none !important;
}

.login_admin .admin-auth-panel {
  min-height: 100vh !important;
  background: transparent !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (min-width: 992px) {
  .lido-auth-wrapper {
    /* Placed gracefully on the right side of the screen */
    justify-content: flex-start;
  }
}

@media (max-width: 991px) {
  .lido-auth-wrapper {
    justify-content: center;
    padding: 30px 20px;
  }

  .lido-auth-card {
    max-width: 440px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.97);
  }

  .lido-auth-card--register {
    max-width: 580px;
  }
}

@media (max-width: 480px) {
  .lido-auth-wrapper {
    padding: 20px 12px;
  }

  .lido-auth-card {
    padding: 34px 20px 28px;
    border-radius: 24px;
  }

  .lido-auth-title {
    font-size: 22px;
  }

  .lido-auth-card--register {
    padding: 30px 16px 24px;
  }

  .lido-register-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
