/* Shared auth split: login, client login, forgot, reset, set-password */

.auth-split-page {
  min-height: 100vh;
  min-height: 100dvh;
}

@media (max-width: 767.98px) {
  .auth-split-page {
    overflow-x: hidden;
  }

  .auth-split-page > .grid > div:first-child {
    padding-top: clamp(28px, 8vw, 64px) !important;
    padding-left: clamp(16px, 4vw, 32px) !important;
    padding-right: clamp(16px, 4vw, 32px) !important;
    padding-bottom: 24px !important;
  }

  .auth-split-page > .grid > div:last-child {
    position: relative;
    padding: 0 16px max(24px, env(safe-area-inset-bottom, 0px));
  }

  .auth-split-page > .grid > div:last-child > img.h-screen,
  .auth-split-page > .grid > div:last-child > img.hidden {
    display: none !important;
  }

  .auth-split-page > .grid > div:last-child > div:not(.absolute) {
    position: relative !important;
    bottom: auto !important;
    width: 100% !important;
  }

  .auth-split-page h1 {
    font-size: clamp(1.5rem, 6vw, 1.875rem) !important;
  }

  .auth-split-page .form-control {
    font-size: 16px !important;
  }
}

@media (min-width: 768px) {
  html:has(.auth-split-page),
  body:has(.auth-split-page) {
    height: 100% !important;
    overflow: hidden !important;
  }

  body:has(.auth-split-page) #root {
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }

  .auth-split-page {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .auth-split-page > .grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .auth-split-page > .grid > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100% !important;
    min-height: 0 !important;
    padding-top: 32px !important;
    padding-bottom: 32px !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-split-page > .grid > div:first-child > div {
    margin-top: auto !important;
    margin-bottom: auto !important;
    width: 100%;
  }

  .auth-split-page > .grid > div:last-child {
    display: block !important;
    position: relative !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    align-self: stretch !important;
    padding: 0 !important;
  }

  .auth-split-page > .grid > div:last-child > img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block !important;
  }

  .auth-split-page > .grid > div:last-child > div {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 24px !important;
    width: 100% !important;
    z-index: 2;
    margin: 0 !important;
  }

  .auth-split-page > .grid > div:last-child > div > div {
    background-image: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1366px) {
  .auth-split-page > .grid > div:first-child {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  .auth-split-page > .grid > div:last-child > div {
    bottom: 16px !important;
  }

  .auth-split-page > .grid > div:last-child > div > div {
    padding: 16px 18px !important;
    gap: 10px !important;
  }

  .auth-split-page > .grid > div:last-child h2 {
    font-size: clamp(1.15rem, 2.1vw, 1.75rem) !important;
    line-height: 1.25 !important;
  }

  .auth-split-page > .grid > div:last-child p {
    font-size: clamp(0.8rem, 1.15vw, 1rem) !important;
    line-height: 1.4 !important;
  }
}

@media (min-width: 768px) and (max-height: 800px) {
  .auth-split-page > .grid > div:first-child {
    justify-content: center !important;
    align-items: center !important;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  .auth-split-page a:has(> img[alt="Logo"]),
  .auth-split-page div:has(> img[alt="Logo"]) {
    margin-bottom: 20px !important;
    max-width: 180px !important;
  }

  .auth-split-page form {
    margin-top: 16px !important;
    margin-bottom: 16px !important;
  }

  .auth-split-page > .grid > div:last-child > div {
    bottom: 12px !important;
  }

  .auth-split-page > .grid > div:last-child > div > div {
    padding: 12px 16px !important;
    gap: 6px !important;
  }

  .auth-split-page > .grid > div:last-child h2 {
    font-size: 1.15rem !important;
  }

  .auth-split-page > .grid > div:last-child p {
    font-size: 0.78rem !important;
  }
}

@media (min-width: 1536px) {
  .auth-split-page > .grid > div:last-child > div {
    bottom: 30px !important;
  }
}

/* Signup (no split image — keep form / stepper usable on small screens) */
@media (max-width: 767.98px) {
  .signup-page {
    padding-top: clamp(28px, 8vw, 56px) !important;
    padding-left: 16px;
    padding-right: 16px;
  }

  .signup-page h1 {
    font-size: clamp(1.5rem, 6vw, 1.875rem) !important;
  }

  .signup-page-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .signup-page-form form {
    padding: 16px !important;
  }

  .signup-page-form .form-control {
    font-size: 16px !important;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .signup-page-form form {
    padding: 24px !important;
  }
}
