/**
 * Auth pages — phones (iOS + Android) + tablets
 */
html.auth-layout-html {
  height: 100%;
  height: -webkit-fill-available;
}

.auth-layout {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(13, 110, 253, 0.12);
  min-height: 100%;
  min-height: -webkit-fill-available;
}

/* Android Chrome / WebView: avoid 100vh jumps when URL bar shows; svh = stable small viewport */
.auth-layout .main-content {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.auth-page-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

@media (min-width: 576px) {
  .auth-page-wrap {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

@media (min-width: 992px) {
  .auth-page-wrap {
    max-width: 930px;
  }
}

/* Card: explicit mobile padding (desktop uses .py-100 / .px-130 from theme) */
.auth-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 991.98px) {
  .auth-card {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

@media (max-width: 575.98px) {
  .auth-card {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
    border-radius: 0.75rem !important;
  }
}

/* Phones: no focus-zoom (iOS + Android Chrome need ≥16px); comfortable touch height */
@media (max-width: 767.98px) {
  .auth-card .form-control,
  .auth-card .form-floating > label {
    font-size: max(1rem, 16px);
  }

  .auth-card .form-floating .form-control {
    min-height: 48px;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .auth-card .password-wrapper .form-control {
    font-size: max(1rem, 16px);
    padding-right: 3rem;
    min-height: 48px;
  }

  /* Password reveal: 48×48px tap target (Android Material / WCAG) */
  .auth-card .password-toggle-icon {
    right: 8px !important;
    width: 48px;
    height: 48px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 22px !important;
    box-sizing: border-box;
  }

  .auth-card .btn-primary[type="submit"] {
    min-height: 48px;
    touch-action: manipulation;
  }

  .auth-card a,
  .auth-card button:not(:disabled) {
    touch-action: manipulation;
  }

  /* Social sign-in circles — at least ~44px for touch */
  .auth-card ul.list-unstyled a[href] {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
  }

  .auth-card .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
  }

  .auth-card .form-check-label {
    padding: 0.35rem 0 0.35rem 0.25rem;
    display: inline-block;
  }
}

.auth-card .fs-26 {
  font-size: clamp(1.25rem, 4.5vw, 1.625rem) !important;
}

.auth-card .sign-in-subtitle {
  font-size: clamp(0.875rem, 3.5vw, 1rem);
  line-height: 1.5;
}

/* Remember / forgot: stack on narrow screens */
.auth-actions-row {
  flex-direction: column;
  align-items: stretch !important;
  gap: 0.75rem !important;
}

@media (min-width: 400px) {
  .auth-actions-row {
    flex-direction: row;
    align-items: center !important;
    justify-content: space-between;
  }
}

/* Theme controls: slightly smaller on phones so they clear home indicator */
@media (max-width: 575.98px) {
  .auth-layout .theme-settings-btn {
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: max(1rem, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    line-height: 46px !important;
  }

  .auth-layout .switch-toggle.dark-btn {
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
  }
}

/* Preloader: keep within viewport */
@media (max-width: 575.98px) {
  .auth-layout .preloader .waviy span {
    font-size: clamp(1.5rem, 8vw, 2rem);
  }
}

/* Login: stacked phone + searchable country list (single column) */
.auth-phone-stack .auth-country-search {
  font-size: max(1rem, 16px);
}

.auth-phone-stack select.auth-country-select[size] {
  display: block;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  line-height: 1.45;
}

.auth-phone-stack select.auth-country-select[size] option {
  padding: 0.35rem 0.5rem;
}
