/*
 * BOMU Convert
 * Customer authentication pages
 *
 * Used by:
 * - Customer login
 * - Customer registration
 * - Password recovery
 *
 * Sections
 * 1. Design tokens and document reset
 * 2. Authentication page layout
 * 3. Header-compatible spacing
 * 4. Intro panel
 * 5. Authentication card
 * 6. Form controls
 * 7. Agreements and validation
 * 8. Buttons and links
 * 9. Footer
 * 10. Responsive rules
 */

/* =========================================================
   1. Design tokens and document reset
   ========================================================= */

:root {
  --auth-primary: #2563eb;
  --auth-primary-dark: #1d4ed8;
  --auth-primary-soft: #eff6ff;
  --auth-text: #172033;
  --auth-heading: #0f172a;
  --auth-muted: #64748b;
  --auth-border: #e2e8f0;
  --auth-background: #f4f7fb;
  --auth-white: #ffffff;
  --auth-danger: #dc2626;
  --auth-success: #16a34a;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

html:has(body.service-auth-page) {
  height: auto !important;
  overflow-y: auto !important;
}

body {
  margin: 0;
  color: var(--auth-text);
  background: var(--auth-background);
}

body.service-auth-page {
  height: auto !important;
  min-width: 0;
  min-height: 100vh;
  color: var(--auth-text);
  background: var(--auth-background) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.service-auth-page::before,
body.service-auth-page::after {
  display: none !important;
  content: none !important;
}

body.service-auth-page .page-content {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: transparent !important;
  overflow: visible !important;
}

body.service-auth-page .content-wrapper,
body.service-auth-page .content-inner,
body.service-auth-page .content {
  width: 100%;
  height: auto !important;
  max-width: none;
  max-height: none !important;
  min-height: 0;
  margin: 0;
  padding: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

body.service-auth-page .content-inner {
  display: block;
}

/* =========================================================
   2. Authentication page layout
   ========================================================= */

.auth-page {
  display: flex;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding-top: 65px;
  color: var(--auth-text);
  background:
    radial-gradient(
      circle at 15% 25%,
      rgba(37, 99, 235, .08),
      transparent 28%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(96, 165, 250, .10),
      transparent 26%
    ),
    var(--auth-background);
  flex-direction: column;
  overflow: visible;
}

.auth-main {
  display: flex;
  padding: 48px 0 58px;
  flex: 1;
  align-items: center;
}

.auth-container {
  width: 100%;
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 28px;
  padding-left: 28px;
}

.auth-layout {
  display: grid;
  max-width: 1120px;
  align-items: center;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(400px, 460px);
  gap: 78px;
}

.auth-layout-register {
  max-width: 1220px;
  align-items: start;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(520px, 590px);
}

/* =========================================================
   3. Header-compatible spacing
   ========================================================= */

/*
 * Authentication pages use the common customer header.
 * It is fixed because the outer Limitless container can scroll.
 */

body.service-auth-page .auth-page > .customer-header,
body.service-auth-page .customer-header {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  z-index: 1060 !important;
  width: 100% !important;
  background: rgba(255, 255, 255, .82) !important;
  box-shadow:
    0 1px 0 rgba(148, 163, 184, .22),
    0 8px 24px rgba(15, 23, 42, .05);
  backdrop-filter: saturate(150%) blur(14px);
  transform: translateZ(0);
}

body.service-auth-page .customer-mobile-drawer-backdrop {
  z-index: 1070;
}

body.service-auth-page .customer-mobile-drawer {
  z-index: 1080;
}

@supports not (
  (backdrop-filter: blur(14px))
  or (-webkit-backdrop-filter: blur(14px))
) {
  body.service-auth-page .auth-page > .customer-header,
  body.service-auth-page .customer-header {
    background: rgba(255, 255, 255, .94) !important;
  }
}

/* =========================================================
   4. Intro panel
   ========================================================= */

.auth-intro {
  padding: 24px 0;
}

.auth-layout-register .auth-intro {
  align-self: start;
  padding-top: 82px;
}

.auth-eyebrow {
  display: inline-flex;
  margin-bottom: 20px;
  padding: 8px 13px;
  color: var(--auth-primary);
  background: var(--auth-primary-soft);
  border: 1px solid #dbeafe;
  border-radius: 999px;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.auth-eyebrow i {
  font-size: 17px;
}

.auth-intro h1 {
  margin: 0 0 18px;
  color: var(--auth-heading);
  font-size: clamp(36px, 3.3vw, 48px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -1.8px;
  word-break: keep-all;
}

.auth-layout-register .auth-intro h1 {
  max-width: 520px;
  margin-bottom: 20px;
  font-size: 43px;
  line-height: 1.18;
  letter-spacing: -1.7px;
}

.auth-intro > p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 16px;
  line-height: 1.8;
  word-break: keep-all;
}

.auth-layout-register .auth-intro > p {
  max-width: 500px;
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.78;
}

.auth-benefits {
  display: grid;
  margin: 28px 0 0;
  padding: 0;
  gap: 13px;
  list-style: none;
}

.auth-benefits li {
  display: flex;
  color: #334155;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

.auth-benefits i {
  color: var(--auth-success);
  font-size: 20px;
}

/* =========================================================
   5. Authentication card
   ========================================================= */

.auth-card {
  width: 100%;
  padding: 32px;
  background: var(--auth-white);
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .07);
}

.auth-register-card {
  padding: 32px 34px;
}

.auth-card-heading {
  margin-bottom: 26px;
  text-align: center;
}

.auth-card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.auth-card-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  color: #ffffff;
  background: var(--auth-primary);
  border-radius: 13px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-card-icon i {
  font-size: 23px;
}

.auth-card-heading h2 {
  margin: 0;
  color: var(--auth-heading);
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -.6px;
}

.auth-register-card .auth-card-heading h2 {
  font-size: 26px;
  letter-spacing: -.7px;
}

.auth-card-heading > p {
  margin: 10px 0 0;
  color: var(--auth-muted);
  font-size: 14px;
}

/* =========================================================
   6. Form controls
   ========================================================= */

.auth-field {
  position: relative;
  margin-bottom: 19px;
}

.auth-field .form-label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.auth-register-card .form-label {
  font-size: 13px;
  letter-spacing: -.1px;
}

.auth-required {
  color: var(--auth-danger);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap > i {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 2;
  color: #94a3b8;
  font-size: 19px;
  pointer-events: none;
  transform: translateY(-50%);
}

.auth-input-wrap .form-control {
  width: 100%;
  height: 48px;
  padding: 0 45px;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  outline: 0;
  font-size: 14px;
  transition:
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.auth-input-wrap .form-control::placeholder {
  color: #a5b1c2;
}

.auth-input-wrap .form-control:hover {
  border-color: #b8c5d7;
}

.auth-input-wrap .form-control:focus {
  background: #ffffff;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.auth-input-wrap .form-control.is-invalid {
  border-color: var(--auth-danger);
}

.auth-input-wrap .form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .09);
}

.auth-input-wrap .form-control.is-valid {
  border-color: var(--auth-success);
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #94a3b8;
  background: transparent;
  border: 0;
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
  color: var(--auth-primary);
  background: var(--auth-primary-soft);
  outline: 0;
}

.auth-password-toggle i {
  font-size: 18px;
}

.auth-help,
.auth-register-card .form-text {
  display: block;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.55;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* =========================================================
   7. Agreements and validation
   ========================================================= */

.auth-divider {
  display: flex;
  margin: 25px 0 20px;
  color: #94a3b8;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: #e8edf4;
  content: "";
  flex: 1;
}

.auth-agreement {
  display: grid;
  margin: 4px 0 20px;
  padding: 13px 14px;
  color: var(--auth-muted);
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 9px;
  gap: 12px;
}

.auth-agreement-item label {
  display: flex;
  margin: 0;
  color: #334155;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.auth-agreement-item + .auth-agreement-item {
  padding-top: 12px;
  border-top: 1px solid #e8edf4;
}

.auth-agreement-item input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--auth-primary);
  flex-shrink: 0;
}

.auth-agreement-title {
  min-width: 0;
}

.auth-agreement-version {
  display: block;
  margin: 3px 0 0 25px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}

.auth-agreement-details {
  display: grid;
  margin: 9px 0 0 25px;
  gap: 5px;
  font-size: 12px;
  line-height: 1.65;
}

.auth-agreement-details > div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
}

.auth-agreement-details dt {
  color: #475569;
  font-weight: 700;
}

.auth-agreement-details dd {
  margin: 0;
  color: var(--auth-muted);
}

.auth-agreement a {
  color: var(--auth-primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-agreement a:hover {
  text-decoration: underline;
}

.auth-alert {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.6;
}

.auth-alert p:last-child {
  margin-bottom: 0;
}

.auth-alert-danger {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.auth-flash-message {
  margin-bottom: 20px;
}

.validation-invalid-label {
  margin-top: 6px;
  color: var(--auth-danger);
  font-size: 12px;
  font-weight: 600;
}

/* =========================================================
   8. Buttons and links
   ========================================================= */

.auth-submit,
.auth-secondary-button {
  display: flex;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 750;
}

.auth-submit {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

.auth-submit:hover,
.auth-submit:focus {
  background: var(--auth-primary-dark);
  border-color: var(--auth-primary-dark);
}

.auth-secondary-button {
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--auth-border);
}

.auth-secondary-button:hover,
.auth-secondary-button:focus {
  color: var(--auth-primary);
  background: var(--auth-primary-soft);
  border-color: #bfdbfe;
}

.auth-submit.is-loading i {
  animation: auth-spin 1s linear infinite;
}

.auth-back-link {
  margin-top: 22px;
  text-align: center;
}

.auth-back-link a {
  display: inline-flex;
  color: var(--auth-muted);
  align-items: center;
  gap: 5px;
  font-size: 13px;
  text-decoration: none;
}

.auth-back-link a:hover {
  color: var(--auth-primary);
}

.auth-mobile-account {
  display: none;
  margin-top: 20px;
  color: var(--auth-muted);
  text-align: center;
  font-size: 13px;
}

.auth-mobile-account a {
  margin-left: 5px;
  color: var(--auth-primary);
  font-weight: 700;
  text-decoration: none;
}

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

/* =========================================================
   9. Footer
   ========================================================= */

.auth-footer {
  background: rgba(255, 255, 255, .55);
  border-top: 1px solid rgba(226, 232, 240, .80);
}

.auth-footer-inner {
  display: flex;
  min-height: 70px;
  color: #94a3b8;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.auth-footer-inner > div {
  display: flex;
  gap: 18px;
}

.auth-footer a {
  color: var(--auth-muted);
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--auth-primary);
}

/* =========================================================
   10. Responsive rules
   ========================================================= */

@media (max-width: 991.98px) {
  .auth-layout,
  .auth-layout-register {
    max-width: 620px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .auth-intro,
  .auth-layout-register .auth-intro {
    padding: 0;
    text-align: center;
  }

  .auth-intro h1,
  .auth-layout-register .auth-intro h1 {
    max-width: none;
    font-size: 36px;
  }

  .auth-intro > p,
  .auth-layout-register .auth-intro > p {
    max-width: none;
  }

  .auth-intro > p br {
    display: none;
  }

  .auth-benefits {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .auth-container {
    padding-right: 16px;
    padding-left: 16px;
  }

  .auth-main {
    padding: 34px 0 42px;
  }

  .auth-intro {
    display: none;
  }

  .auth-card,
  .auth-register-card {
    padding: 26px 22px;
  }

  .auth-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 575.98px) {
  .auth-page {
    padding-top: 65px;
  }

  .auth-main {
    padding: 24px 0 32px;
    align-items: flex-start;
  }

  .auth-card,
  .auth-register-card {
    padding: 24px 18px;
    border-radius: 14px;
  }

  .auth-card-heading {
    margin-bottom: 24px;
  }

  .auth-card-heading h2,
  .auth-register-card .auth-card-heading h2 {
    font-size: 23px;
  }

  .auth-input-wrap .form-control {
    font-size: 16px;
  }

  .auth-agreement-details > div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-mobile-account {
    display: block;
  }

  .auth-footer-inner {
    min-height: auto;
    padding-top: 18px;
    padding-bottom: 18px;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    text-align: center;
  }
}
