/* Front auth forms — dark tokens, modal OTP, role cards */

.lppd-auth-form-wrap {
  max-width: 26rem;
  margin: 0 auto;
  padding: 1rem 0.75rem 2rem;
}

.lppd-auth-card {
  background: var(--lppd-bg-2, #151922);
  border: 1px solid var(--lppd-border, #2a3140);
  border-radius: var(--lppd-radius, 12px);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.lppd-auth-card--elevated {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.35);
}

.lppd-auth-card__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.lppd-auth-card__mark {
  display: block;
  width: 2.5rem;
  height: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lppd-accent, #7ee787), var(--lppd-focus, #6eb5ff));
  opacity: 0.9;
}

.lppd-auth-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--lppd-text, #e8ecf1);
  text-align: center;
}

.lppd-auth-card__lead {
  margin: 0 0 1.35rem;
  color: var(--lppd-text-muted, #9aa3b2);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

.lppd-auth-form .lppd-auth-field:first-of-type {
  margin-top: 0;
}

.lppd-auth-field {
  margin-bottom: 1rem;
}

.lppd-auth-field--inline {
  margin-bottom: 0.5rem;
}

.lppd-auth-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--lppd-text-muted, #9aa3b2);
}

.lppd-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--lppd-text, #e8ecf1);
}

.lppd-auth-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--lppd-accent, #7ee787);
}

.lppd-auth-input,
.lppd-auth-field input[type="text"],
.lppd-auth-field input[type="email"],
.lppd-auth-field input[type="password"],
.lppd-auth-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--lppd-border, #2a3140);
  background: var(--lppd-bg-1, #0f1218);
  color: var(--lppd-text, #e8ecf1);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lppd-auth-input:focus,
.lppd-auth-field input:focus,
.lppd-auth-field select:focus {
  outline: none;
  border-color: var(--lppd-focus, #6eb5ff);
  box-shadow: 0 0 0 3px rgba(110, 181, 255, 0.2);
}

.lppd-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1.35rem;
}

.lppd-auth-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.lppd-auth-actions--stack .lppd-button--block {
  width: 100%;
  justify-content: center;
}

.lppd-auth-actions--modal {
  margin-top: 1rem;
}

.lppd-auth-actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.lppd-auth-actions .lppd-button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
  font-size: 0.9375rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.lppd-auth-actions .lppd-button--primary {
  background: var(--lppd-accent, #7ee787);
  color: #0b0d10;
  font-weight: 600;
}

.lppd-auth-actions .lppd-button--primary:hover {
  filter: brightness(1.05);
}

.lppd-auth-actions .lppd-button--ghost {
  background: transparent;
  color: var(--lppd-focus, #6eb5ff);
  border: 1px solid var(--lppd-border, #2a3140);
}

.lppd-auth-actions .lppd-button--ghost:hover {
  border-color: var(--lppd-focus, #6eb5ff);
  background: rgba(110, 181, 255, 0.06);
}

.lppd-auth-notice {
  display: none;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--lppd-danger, #ff6b6b);
  background: rgba(255, 107, 107, 0.1);
  color: var(--lppd-danger, #ff8a8a);
  font-size: 0.875rem;
  line-height: 1.4;
}

.lppd-auth-notice--modal {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.lppd-auth-notice.is-visible {
  display: block;
}

.lppd-auth-notice--ok {
  border-color: var(--lppd-accent, #7ee787);
  background: rgba(126, 231, 135, 0.1);
  color: var(--lppd-accent, #9ee8a8);
}

.lppd-auth-links {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--lppd-text-muted, #9aa3b2);
  text-align: center;
  line-height: 1.5;
}

.lppd-auth-links__sep {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.lppd-auth-links a {
  color: var(--lppd-focus, #6eb5ff);
  text-decoration: none;
}

.lppd-auth-links a:hover {
  text-decoration: underline;
}

.lppd-auth-hint {
  font-size: 0.8125rem;
  color: var(--lppd-text-muted, #9aa3b2);
  margin: 0.35rem 0 0;
}

/* Role selection (register) */
.lppd-auth-role-fieldset {
  border: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.lppd-auth-role-legend {
  display: block;
  width: 100%;
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--lppd-text-muted, #9aa3b2);
}

.lppd-auth-role-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lppd-auth-role-card {
  position: relative;
  display: block;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--lppd-border, #2a3140);
  background: var(--lppd-bg-1, #0f1218);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.lppd-auth-role-card:hover {
  border-color: rgba(110, 181, 255, 0.45);
}

.lppd-auth-role-card:has(input:checked) {
  border-color: var(--lppd-accent, #7ee787);
  background: rgba(126, 231, 135, 0.06);
  box-shadow: 0 0 0 1px rgba(126, 231, 135, 0.25);
}

.lppd-auth-role-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.lppd-auth-role-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 1.5rem;
  position: relative;
}

.lppd-auth-role-card__body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid var(--lppd-border, #2a3140);
  background: transparent;
}

.lppd-auth-role-card:has(input:checked) .lppd-auth-role-card__body::before {
  border-color: var(--lppd-accent, #7ee787);
  background: radial-gradient(circle, var(--lppd-accent, #7ee787) 45%, transparent 46%);
}

.lppd-auth-role-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lppd-text, #e8ecf1);
}

.lppd-auth-role-card__desc {
  font-size: 0.8125rem;
  color: var(--lppd-text-muted, #9aa3b2);
  line-height: 1.35;
}

/* OTP digits (modal + legacy) */
.lppd-auth-otp__digits {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0.5rem 0 0.25rem;
}

.lppd-auth-otp__digits input {
  width: 2.5rem;
  height: 2.75rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--lppd-border, #2a3140);
  background: var(--lppd-bg-1, #0f1218);
  color: var(--lppd-text, #e8ecf1);
}

.lppd-auth-otp__digits input:focus {
  outline: none;
  border-color: var(--lppd-focus, #6eb5ff);
  box-shadow: 0 0 0 3px rgba(110, 181, 255, 0.2);
}

/* Modal */
body.lppd-auth-modal-open {
  overflow: hidden;
}


.lppd-auth-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem;
  box-sizing: border-box;
}

.lppd-auth-modal[hidden] {
  display: none !important;
}

.lppd-auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(6px);
}

.lppd-auth-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  max-height: min(90vh, 32rem);
  overflow-y: auto;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--lppd-border, #2a3140);
  background: var(--lppd-bg-2, #151922);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  animation: lppd-auth-modal-in 0.22s ease-out;
}

@keyframes lppd-auth-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lppd-auth-modal__dismiss {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--lppd-text-muted, #9aa3b2);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lppd-auth-modal__dismiss:hover {
  color: var(--lppd-text, #e8ecf1);
  background: rgba(255, 255, 255, 0.06);
}

.lppd-auth-modal__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--lppd-focus, #6eb5ff);
}

.lppd-auth-modal__icon--ok {
  color: var(--lppd-accent, #7ee787);
}

.lppd-auth-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 650;
  text-align: center;
  color: var(--lppd-text, #e8ecf1);
}

.lppd-auth-modal__lead {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
  color: var(--lppd-text-muted, #9aa3b2);
}

.lppd-auth-modal__hint {
  text-align: center;
  margin-top: 0.75rem;
}

.lppd-auth-modal__view[hidden] {
  display: none !important;
}

/* Fallback when :has() unsupported — rely on focus-within for hover-like state */
@supports not selector(:has(*)) {
  .lppd-auth-role-card input:focus ~ .lppd-auth-role-card__body::before {
    border-color: var(--lppd-focus, #6eb5ff);
  }
}

/* Trust / secure identity (email OTP + reCAPTCHA disclosures) */
.lppd-auth-trust {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--lppd-border, #2a3140);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--lppd-text-muted, #9aa3b2);
}

.lppd-auth-trust--modal {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top-color: rgba(255, 255, 255, 0.06);
}

.lppd-auth-trust__row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0;
}

.lppd-auth-trust__row + .lppd-auth-trust__row {
  margin-top: 0.55rem;
}

.lppd-auth-trust__icon {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 0.1rem;
  color: var(--lppd-accent, #7ee787);
  opacity: 0.9;
}

.lppd-auth-trust__row--recaptcha .lppd-auth-trust__icon {
  color: var(--lppd-focus, #6eb5ff);
}

.lppd-auth-trust__text {
  flex: 1;
  min-width: 0;
}

.lppd-auth-trust__text a {
  color: var(--lppd-focus, #6eb5ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lppd-auth-trust__text a:hover {
  color: var(--lppd-text, #e8ecf1);
}

@media (prefers-reduced-motion: reduce) {
  .lppd-auth-modal__panel {
    animation: none;
  }
}
