/*
 * Account auth pages: Bootstrap 5.3 first.
 * Custom CSS is limited to page layout, auth tabs, submit state and toast.
 * Reusable field/button deltas are loaded by the controller from components/forms.css.
 */

.account-auth {
  --account-auth-bg: var(--body-bg, #f9f9f9);
  --account-auth-text: var(--ui-black-1, #301905);
  --account-auth-muted: var(--bs-secondary-color, #665f58);
  --account-auth-accent: var(--ui-orange-1, #f68e1e);
  --account-auth-accent-dark: var(--ui-orange-2, #8e6e52);
  --account-auth-border: var(--lm-line, var(--bs-border-color, #dee2e6));
  --account-auth-focus-rgb: var(--bs-warning-rgb, 255, 193, 7);
  --lm-form-bg: var(--account-auth-bg);
  --lm-form-text: var(--account-auth-text);
  --lm-form-muted: var(--account-auth-muted);
  --lm-form-accent: var(--account-auth-accent);
  --lm-form-border: var(--account-auth-border);
  --lm-form-focus-rgb: var(--account-auth-focus-rgb);

  background: var(--account-auth-bg);
  color: var(--account-auth-text);
  padding: 72px 0;
}

.min-w-0 { min-width: 0; }

.account-auth .lm-section-title {
  position: relative;
  display: inline-block;
  margin: 0 0 36px;
  color: var(--account-auth-text);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .03em;
  text-transform: uppercase;
}


.account-auth [data-auth-form="register"] {
  row-gap: 36px !important;
}

/* Account-specific active pane/label wiring. Visual tab styles live in components/forms.css. */
#account-auth-tab-login:checked ~ .lm-auth-tabs [data-tab="login"],
#account-auth-tab-register:checked ~ .lm-auth-tabs [data-tab="register"] {
  color: var(--account-auth-accent);
}

#account-auth-tab-login:checked ~ .lm-auth-tabs [data-tab="login"]::after,
#account-auth-tab-register:checked ~ .lm-auth-tabs [data-tab="register"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--account-auth-accent);
}

.account-auth [data-auth-pane] { display: none; }
#account-auth-tab-login:checked ~ [data-auth-card] [data-auth-pane="login"],
#account-auth-tab-register:checked ~ [data-auth-card] [data-auth-pane="register"],
.account-auth [data-auth-pane].is-active { display: block; }

.account-auth .btn-warning {
  --bs-btn-bg: var(--account-auth-accent);
  --bs-btn-border-color: var(--account-auth-accent);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: var(--account-auth-accent);
  --bs-btn-hover-color: var(--account-auth-accent);
  --bs-btn-active-bg: var(--account-auth-accent-dark);
  --bs-btn-active-border-color: var(--account-auth-accent-dark);
  --bs-btn-active-color: #fff;
}

.account-auth form.is-loading {
  opacity: .78;
}

.account-auth form.is-loading [type="submit"] {
  cursor: wait;
}

.account-auth-toast-wrap {
  position: fixed;
  z-index: 1080;
  top: 92px;
  right: 24px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.account-auth-toast {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--account-auth-border);
  background: #fff;
  color: var(--account-auth-text);
  box-shadow: 0 16px 38px rgba(48, 25, 5, .16);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .18s ease-in-out, transform .18s ease-in-out;
  pointer-events: auto;
}

.account-auth-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.account-auth-toast--error { border-left: 4px solid var(--bs-danger, #dc3545); }
.account-auth-toast--success { border-left: 4px solid var(--bs-success, #198754); }

.account-auth-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--account-auth-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.account-auth-toast--error .account-auth-toast__icon { background: var(--bs-danger, #dc3545); }
.account-auth-toast--success .account-auth-toast__icon { background: var(--bs-success, #198754); }

.account-auth-toast__body {
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}

.account-auth-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--account-auth-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.account-auth-toast__close:hover,
.account-auth-toast__close:focus {
  color: var(--account-auth-text);
}

@media (max-width: 767.98px) {
  .account-auth { padding: 40px 0 56px; }

  .account-auth .lm-section-title {
    margin-bottom: 28px;
  }

  .account-auth .lm-tabs {
    gap: 26px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .account-auth .lm-tabs::-webkit-scrollbar { display: none; }

  .account-auth .lm-tab {
    flex: 0 0 auto;
    padding: 14px 0 18px;
    font-size: 14px;
    white-space: nowrap;
  }

  .account-auth-toast-wrap {
    top: 72px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}
