/* ==========================================================================
   IN MADRA - AUTH & PASSWORD RESET MODALS & DRAWERS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL MODAL OVERLAYS & BACKDROPS (MEGAMENU FULLSCREEN DROPDOWN)
   -------------------------------------------------------------------------- */
.im-auth-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  background-color: rgba(28, 27, 24, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  padding: 0;
  margin: 0;
}

.im-auth-overlay.active {
  opacity: 1;
  visibility: visible;
}

.im-drawer-overlay,
.im-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: rgba(28, 27, 24, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.im-drawer-overlay.active,
.im-success-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Ensure site header stays above the auth dropdown when open */
body.im-auth-open .im-site-header {
  z-index: 10001 !important;
  background-color: #FFFFFF !important;
  --im-header-nav-color: #1C1B18 !important;
  border-bottom: 1px solid #E6E2DA !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.im-auth-open .im-header-home:not(.scrolled) {
  position: absolute !important;
  top: 35px !important;
  background-color: #FFFFFF !important;
}

body.im-auth-open .im-header-home.scrolled {
  position: sticky !important;
  top: 0 !important;
  background-color: #FFFFFF !important;
}

body.im-auth-open .im-logo-white {
  display: none !important;
}

body.im-auth-open .im-logo-red {
  display: block !important;
}

body.im-auth-open .im-site-header a,
body.im-auth-open .im-nav-left a,
body.im-auth-open .im-nav-right a {
  color: #1C1B18 !important;
}

body.im-auth-open .im-top-bar {
  position: relative !important;
  z-index: 10002 !important;
}

/* --------------------------------------------------------------------------
   2. SIGN IN & SIGN UP MODAL (FULL-WIDTH MEGAMENU FIGMA MATCH)
   -------------------------------------------------------------------------- */
.im-auth-modal {
  position: fixed;
  top: var(--im-header-bottom, 90px);
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100vw;
  height: min(650px, calc(100vh - var(--im-header-bottom, 90px)));
  margin: 0;
  padding: 0;
  background-color: #FFFFFF;
  border-radius: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#im-signup-modal.im-auth-modal {
  height: calc(100vh - var(--im-header-bottom, 90px));
}

.im-auth-overlay.active .im-auth-modal {
  transform: translateY(0);
}

.im-auth-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 2.25rem;
  z-index: 10;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #1C1B18;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.im-auth-modal-close:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

.im-auth-modal-grid {
  display: grid;
  grid-template-columns: 38% 62%;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.im-auth-modal-banner {
  background-color: #ECE9E3;
  overflow: hidden;
  position: relative;
  height: 100%;
  width: 100%;
}

.im-auth-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.im-auth-modal-content {
  padding: 3rem 5.5rem 2.5rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #FFFFFF;
  overflow-y: auto;
  height: 100%;
}

.im-auth-form {
  max-width: 480px;
  width: 100%;
}

.im-auth-title {
  font-family: var(--im-font-heading, 'Stack Sans Text', 'Plus Jakarta Sans', sans-serif);
  font-size: 2rem;
  font-weight: 400;
  color: #1C1B18;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

/* Form Styles */
.im-form-group {
  margin-bottom: 1.15rem;
  position: relative;
}

.im-form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1C1B18;
  margin-bottom: 0.25rem;
}

.im-required {
  color: #FE3E00;
  font-weight: 700;
}

.im-form-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #D8D4CC;
  background: transparent;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: #1C1B18;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.im-form-input::placeholder {
  color: #A8A49C;
  font-weight: 400;
}

.im-form-input:focus {
  border-bottom-color: #1C1B18;
}

.im-input-with-icon {
  position: relative;
}

.im-toggle-password {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6B6862;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.im-toggle-password:hover {
  color: #1C1B18;
}

.im-forgot-row {
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.im-forgot-link {
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1C1B18;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.im-forgot-link:hover {
  color: #FE3E00;
}

.im-auth-btn-primary {
  width: 100%;
  height: 48px;
  background-color: #1C1B18;
  color: #FFFFFF;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.im-auth-btn-primary:hover {
  background-color: #333333;
}

/* Social Auth Divider */
.im-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.15rem 0;
  color: #A09C95;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.im-auth-divider::before,
.im-auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #E8E5DF;
}

.im-auth-divider span {
  padding: 0 0.85rem;
}

/* Google Sign In / Sign Up Button */
.im-btn-google-auth {
  width: 100%;
  height: 48px;
  background-color: #FFFFFF;
  color: #1C1B18;
  border: 1px solid #E2DED7;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1.5rem;
}

.im-btn-google-auth:hover {
  background-color: #FAF9F5;
  border-color: #CFCAC0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.im-google-icon {
  flex-shrink: 0;
}

.im-auth-switch-text {
  font-size: 0.775rem;
  color: #6B6862;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.im-create-account-link {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1C1B18;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.im-create-account-link:hover {
  color: #FE3E00;
}

.im-auth-footer-trust {
  border-top: 1px solid #F0EEE9;
  padding-top: 1.25rem;
}

.im-trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.im-trust-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1C1B18;
}

.im-trust-terms {
  font-size: 0.725rem;
  color: #8C8880;
  margin: 0;
}

.im-terms-link {
  color: #1C1B18;
  font-weight: 600;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   3. CHANGE PASSWORD DRAWER (SLIDE-IN FROM RIGHT)
   -------------------------------------------------------------------------- */
.im-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.im-slide-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background-color: #FFFFFF;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
}

.im-drawer-overlay.active .im-slide-drawer {
  transform: translateX(0);
}

.im-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid #F0EEE9;
}

.im-drawer-title {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1C1B18;
  margin: 0;
}

.im-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #1C1B18;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.im-drawer-close:hover {
  opacity: 0.7;
}

.im-drawer-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.im-drawer-helper-text {
  font-size: 0.8rem;
  color: #6B6862;
  margin-top: 1rem;
  line-height: 1.5;
  text-align: center;
}

.im-drawer-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #F0EEE9;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background-color: #FFFFFF;
}

.im-drawer-btn-cancel {
  height: 46px;
  background: #FFFFFF;
  color: #1C1B18;
  border: 1px solid #D8D4CC;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.im-drawer-btn-cancel:hover {
  background: #FAF9F5;
  border-color: #1C1B18;
}

.im-drawer-btn-submit {
  height: 46px;
  background: #1C1B18;
  color: #FFFFFF;
  border: 1px solid #1C1B18;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.im-drawer-btn-submit:hover {
  background: #333333;
}

/* --------------------------------------------------------------------------
   4. SUCCESS MODAL (PASSWORD UPDATED)
   -------------------------------------------------------------------------- */
.im-success-modal {
  background: #FFFFFF;
  width: 90%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  text-align: center;
  border-radius: 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.im-success-overlay.active .im-success-modal {
  transform: scale(1);
}

.im-success-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.im-success-title {
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1C1B18;
  margin-bottom: 0.75rem;
}

.im-success-desc {
  font-size: 0.85rem;
  color: #6B6862;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.im-success-btn-ok {
  width: 100%;
  height: 46px;
  background: #1C1B18;
  color: #FFFFFF;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.im-success-btn-ok:hover {
  background: #333333;
}

/* --------------------------------------------------------------------------
   5. PASSWORD REQUIREMENTS CHECKLIST (LIVE DYNAMIC)
   -------------------------------------------------------------------------- */
.im-password-requirements {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-top: 0.65rem;
  font-size: 0.775rem;
  color: #8E8A83;
}

.im-req-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #8E8A83 !important;
  font-weight: 400;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.im-req-icon,
.im-req-item .req-icon {
  stroke: #8E8A83 !important;
  color: #8E8A83 !important;
  opacity: 0.5;
  transition: stroke 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.im-req-item.valid {
  color: #2E7D32 !important;
  font-weight: 600;
}

.im-req-item.valid .im-req-icon,
.im-req-item.valid .req-icon {
  stroke: #2E7D32 !important;
  color: #2E7D32 !important;
  opacity: 1 !important;
}

.im-req-dot {
  color: #C8C4BC;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. ALERTS & FEEDBACK
   -------------------------------------------------------------------------- */
.im-auth-alert {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

.im-auth-alert-error {
  background-color: #FDF2F2;
  border-left: 3px solid #E53935;
  color: #C62828;
}

.im-auth-alert-success {
  background-color: #F1F8F4;
  border-left: 3px solid #2E7D32;
  color: #1B5E20;
}

/* Spinner */
.im-btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: im-spin 0.8s linear infinite;
}

@keyframes im-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   8. SIGN UP MODAL & PAGE (EXACT FIGMA MATCH)
   -------------------------------------------------------------------------- */
.im-signup-modal-wrap {
  width: 100vw !important;
  max-width: 100vw !important;
  height: calc(100vh - var(--im-header-bottom, 90px)) !important;
}

.im-signup-modal-grid {
  display: grid;
  grid-template-columns: 38% 62%;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.im-signup-content {
  padding: 3rem 6rem 3rem 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-color: #FFFFFF;
  overflow-y: auto;
  height: 100%;
  max-height: calc(100vh - var(--im-header-bottom, 90px));
}

.im-signup-content .im-auth-form {
  max-width: 520px;
  width: 100%;
}

.im-signup-title {
  font-family: var(--im-font-heading, 'Stack Sans Text', 'Plus Jakarta Sans', sans-serif);
  font-size: 2.25rem;
  font-weight: 400;
  color: #1C1B18;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

.im-form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}



/* Custom Square Checkboxes */
.im-signup-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.im-custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.im-custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.im-checkbox-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid #1C1B18;
  background-color: #FFFFFF;
  margin-top: 2px;
  transition: all 0.2s ease;
  position: relative;
  display: block;
}

.im-custom-checkbox input[type="checkbox"]:checked + .im-checkbox-box {
  background-color: #1C1B18;
  border-color: #1C1B18;
}

.im-custom-checkbox input[type="checkbox"]:checked + .im-checkbox-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.im-checkbox-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1C1B18;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.im-checkbox-sub {
  font-size: 0.775rem;
  color: #666666;
  line-height: 1.45;
  margin: 0;
  font-weight: 400;
}

.im-btn-create-account {
  width: 100%;
  background-color: #1C1B18;
  color: #FFFFFF;
  border: none;
  padding: 1.1rem 1.5rem;
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.im-btn-create-account:hover {
  background-color: #33322E;
}

.im-already-part-bar {
  background-color: #FAF9F5;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  border: 1px solid #F0EDE6;
}

.im-already-text {
  font-size: 0.825rem;
  color: #666666;
  font-weight: 400;
}

.im-signin-switch-btn {
  background: transparent;
  border: none;
  font-size: 0.775rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1C1B18;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.im-signin-switch-btn:hover {
  color: #FE3E00;
}

.im-auth-footer-trust {
  margin-top: 1rem;
  border-top: 1px solid #F0EDE6;
  padding-top: 1.25rem;
}

.im-trust-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.im-trust-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1C1B18;
  display: block;
  line-height: 1.2;
}

.im-trust-sub {
  font-size: 0.775rem;
  color: #666666;
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.im-trust-terms {
  font-size: 0.75rem;
  color: #8E8A83;
  margin: 0;
}

.im-terms-link {
  color: #1C1B18;
  font-weight: 700;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .im-auth-modal-grid {
    grid-template-columns: 1fr;
  }

  .im-auth-modal-banner {
    display: none;
  }

  .im-auth-modal-content {
    padding: 2.5rem 1.75rem;
  }

  .im-form-row-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .im-slide-drawer {
    max-width: 100%;
  }

  .im-otp-digits-container {
    gap: 0.5rem;
  }

  .im-otp-digit {
    width: 42px;
    height: 48px;
    font-size: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   9. OTP VERIFICATION PAGE & MODAL (EXACT FIGMA MATCH - Attached 1, 2, 3)
   -------------------------------------------------------------------------- */
.im-otp-digits-container {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.im-otp-digit {
  width: 54px;
  height: 60px;
  border: none;
  border-bottom: 1.5px solid #1C1B18;
  background: transparent;
  text-align: center;
  font-size: 1.85rem;
  font-family: inherit;
  font-weight: 500;
  color: #1C1B18;
  outline: none;
  text-transform: uppercase;
  transition: border-color 0.2s ease;
}

.im-otp-digit:focus {
  border-bottom-color: #FE3E00;
}

.im-btn-confirm-otp {
  width: 100%;
  height: 50px;
  background-color: #F0EEE9 !important;
  color: #8E8A83 !important;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.im-btn-confirm-otp:not(:disabled) {
  background-color: #1C1B18 !important;
  color: #FFFFFF !important;
  cursor: pointer !important;
}

.im-btn-confirm-otp:not(:disabled):hover {
  background-color: #333333 !important;
}

.im-otp-sent-modal {
  text-align: center;
  padding: 3.5rem 3rem;
  max-width: 480px;
  background: #FFFFFF;
}

.im-otp-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.im-otp-sent-title {
  font-family: var(--im-font-heading, 'Stack Sans Text', 'Plus Jakarta Sans', sans-serif);
  font-size: 1.85rem;
  font-weight: 400;
  color: #1C1B18;
  margin-bottom: 0.85rem;
  letter-spacing: -0.01em;
}

.im-otp-sent-desc {
  font-size: 0.875rem;
  color: #6B6862;
  line-height: 1.6;
  margin-bottom: 2.25rem;
}

.im-otp-enter-code-btn {
  width: 100%;
  height: 48px;
  background: #1C1B18 !important;
  color: #FFFFFF !important;
  border: none;
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.im-otp-enter-code-btn:hover {
  background: #333333 !important;
}


