:root {
  --lp-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --lp-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --lp-bg: #0a0d11;
  --lp-bg-elev: #0d1117;
  --lp-surface: rgba(255, 255, 255, 0.025);
  --lp-surface-strong: rgba(255, 255, 255, 0.045);
  --lp-border: rgba(255, 255, 255, 0.07);
  --lp-border-strong: rgba(255, 255, 255, 0.12);
  --lp-text: #ecf2ee;
  --lp-text-strong: #ffffff;
  --lp-text-muted: rgba(232, 239, 233, 0.58);
  --lp-text-faint: rgba(232, 239, 233, 0.38);
  --lp-accent: #0a714e;
  --lp-accent-strong: #0d8a5e;
  --lp-accent-dim: rgba(10, 113, 78, 0.22);
  --lp-accent-glow: rgba(10, 113, 78, 0.38);
  --lp-on-accent: #ffffff;
  --lp-danger-bg: rgba(232, 76, 76, 0.10);
  --lp-danger-border: rgba(255, 130, 130, 0.28);
  --lp-danger-text: #ffb4b4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body.lp {
  height: 100vh;
  min-height: 100vh;
  background: var(--lp-bg);
  color: var(--lp-text);
  font-family: var(--lp-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  /* Anchor from the top so logo + toggle don't slide between views, and
   * lock the viewport so the page is rigid in both views (matches Admin). */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(48px, 10vh, 120px) 20px 32px;
  overflow: hidden;
}

/* ---------- background: solid dark, no animations ---------- */
.lp-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--lp-bg);
}

/* ---------- shell ---------- */
.lp-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
}

.lp-head {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.lp-logo {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 22px rgba(45, 232, 171, 0.07));
}

/* ---------- segmented toggle ---------- */
.lp-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  padding: 4px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: 12px;
}
.lp-toggle-btn {
  position: relative;
  z-index: 1;
  appearance: none;
  background: transparent;
  color: var(--lp-text-muted);
  border: 0;
  padding: 9px 16px;
  font-family: var(--lp-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 9px;
  transition: color 180ms ease;
}
.lp-toggle-btn:hover { color: var(--lp-text); }
.lp-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--lp-accent-glow);
}
.lp-toggle-btn.is-active {
  color: var(--lp-on-accent);
}
.lp-toggle-ink {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--lp-accent);
  border-radius: 9px;
  z-index: 0;
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 18px rgba(45, 232, 171, 0.22);
}
.lp-toggle[data-active="admin"] .lp-toggle-ink {
  transform: translateX(100%);
}

/* ---------- card ---------- */
.lp-card {
  background: linear-gradient(180deg, rgba(15, 19, 25, 0.86), rgba(11, 14, 19, 0.92));
  border: 1px solid var(--lp-border);
  border-radius: 16px;
  padding: 32px 28px;
  /* Keep both Client and Admin cards the same height so toggling between
   * them doesn't make the support link / logo slide around. The taller
   * Client card (with terms + support link) sets the floor. */
  min-height: 440px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.lp-card[hidden] { display: none; }

.lp-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}
.lp-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lp-accent);
  font-weight: 600;
}
/* Same typography on Client and Admin — the smaller admin-style scale is
 * the shared baseline now, so both views read as part of the same product. */
.lp-title {
  margin: 0;
  font-family: var(--lp-font);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--lp-text-strong);
  font-weight: 600;
}
.lp-sub {
  margin: 0;
  font-family: var(--lp-font);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--lp-text-faint);
}

/* ---------- form ---------- */
.lp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lp-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lp-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lp-text-muted);
  font-weight: 600;
}
.lp-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  background: var(--lp-bg-elev);
  color: var(--lp-text-strong);
  border: 1px solid var(--lp-border);
  border-radius: 10px;
  font-family: var(--lp-font);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.lp-input::placeholder { color: var(--lp-text-faint); }
.lp-input:hover { border-color: var(--lp-border-strong); }
.lp-input:focus {
  outline: none;
  border-color: var(--lp-accent);
  box-shadow: 0 0 0 3px var(--lp-accent-dim);
  background: var(--lp-bg-elev);
}

/* ---------- remember-me switch ---------- */
.lp-remember {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  color: var(--lp-text-muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.lp-remember-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.lp-remember-switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  background: var(--lp-surface-strong);
  border: 1px solid var(--lp-border-strong);
  border-radius: 999px;
  transition: background 200ms ease, border-color 200ms ease;
}
.lp-remember-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lp-text-muted);
  border: 1px solid transparent;
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.lp-remember-input:checked + .lp-remember-switch {
  background: var(--lp-accent);
  border-color: var(--lp-accent);
}
.lp-remember-input:checked + .lp-remember-switch .lp-remember-knob {
  transform: translateX(14px);
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
.lp-remember-input:focus-visible + .lp-remember-switch {
  box-shadow: 0 0 0 3px var(--lp-accent-dim);
}

/* ---------- buttons ---------- */
.lp-submit {
  appearance: none;
  border: 0;
  margin-top: 4px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  background: var(--lp-accent);
  color: var(--lp-on-accent);
  font-family: var(--lp-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 10px;
  cursor: pointer;
  transition: background 160ms ease, transform 100ms ease, box-shadow 160ms ease;
  box-shadow: 0 12px 26px rgba(10, 113, 78, 0.30);
}
.lp-submit:hover {
  background: var(--lp-accent-strong);
  color: var(--lp-on-accent);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(10, 113, 78, 0.40);
}
.lp-submit:active { transform: translateY(0); }
.lp-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--lp-accent-dim), 0 12px 26px rgba(10, 113, 78, 0.40);
}
.lp-submit--accent { /* kept as alias for backwards compatibility */ }

/* ---------- error + terms ---------- */
.lp-error {
  background: var(--lp-danger-bg);
  border: 1px solid var(--lp-danger-border);
  color: var(--lp-danger-text);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
}
.lp-error[hidden] { display: none; }

/* ---------- support modal row: email + inline copy ---------- */
.lp-support-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 10px 14px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: 10px;
}
.lp-support-email {
  flex: 1 1 auto;
  min-width: 0;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 3px;
  font-family: var(--lp-font-mono);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-support-copy {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid var(--lp-accent);
  background: transparent;
  color: var(--lp-accent-strong);
  font-family: var(--lp-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.lp-support-copy:hover {
  background: var(--lp-accent);
  color: var(--lp-on-accent);
}
.lp-support-copy:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--lp-accent-dim);
}

/* ---------- terms-of-use confirm (modal) ---------- */
.lp-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0 16px;
  cursor: pointer;
  user-select: none;
  color: var(--lp-text);
  font-size: 13px;
  line-height: 1.4;
}
.lp-terms-check-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.lp-terms-check-box {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--lp-border-strong);
  background: var(--lp-bg-elev);
  border-radius: 5px;
  transition: background 160ms ease, border-color 160ms ease;
}
.lp-terms-check-tick {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 9px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg) scale(0.6);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}
.lp-terms-check-input:checked + .lp-terms-check-box {
  background: var(--lp-accent);
  border-color: var(--lp-accent);
}
.lp-terms-check-input:checked + .lp-terms-check-box .lp-terms-check-tick {
  transform: rotate(45deg) scale(1);
  opacity: 1;
}
.lp-terms-check-input:focus-visible + .lp-terms-check-box {
  box-shadow: 0 0 0 3px var(--lp-accent-dim);
}
.lp-terms-check-label { flex: 1; }
.lp-terms-continue {
  margin-top: 0;
  margin-bottom: 8px;
}
.lp-terms-continue:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--lp-text-faint);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.lp-terms-continue:disabled:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--lp-text-faint);
  transform: none;
  box-shadow: none;
}
.lp-help-row {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.lp-help-link {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  color: var(--lp-text-muted);
  font-family: var(--lp-font);
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 160ms ease, background 160ms ease;
}
.lp-help-link:hover { color: var(--lp-accent); }
.lp-help-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--lp-accent-dim);
}

/* ---------- modal (support picker) ---------- */
.lp-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lp-modal[hidden] { display: none; }
.lp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 8, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lp-fade 160ms ease;
}
.lp-modal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, #11161c, #0c1014);
  border: 1px solid var(--lp-border-strong);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55);
  animation: lp-pop 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.lp-modal-head {
  margin-bottom: 16px;
}
.lp-modal-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--lp-text-strong);
}
.lp-modal-close {
  appearance: none;
  background: transparent;
  border: 0;
  width: 100%;
  padding: 10px;
  color: var(--lp-text-faint);
  font-family: var(--lp-font);
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  transition: color 160ms ease;
}
.lp-modal-close:hover { color: var(--lp-text); }

@keyframes lp-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lp-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- top-right notification (error + copy confirmation) ---------- */
.lp-notify {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 70;
  max-width: 360px;
  min-width: 240px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 25, 31, 0.96), rgba(13, 17, 21, 0.96));
  border: 1px solid var(--lp-border-strong);
  color: var(--lp-text);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: lp-notify-in 200ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.lp-notify[hidden] { display: none; }
.lp-notify-icon {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--lp-accent);
  box-shadow: 0 0 12px var(--lp-accent-glow);
}
.lp-notify-text {
  flex: 1 1 auto;
  word-break: break-word;
}
.lp-notify--error {
  border-color: var(--lp-danger-border);
}
.lp-notify--error .lp-notify-icon {
  background: #ff8585;
  box-shadow: 0 0 12px rgba(255, 133, 133, 0.4);
}
.lp-notify--leaving {
  animation: lp-notify-out 240ms ease forwards;
}
@keyframes lp-notify-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes lp-notify-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}
@media (max-width: 480px) {
  .lp-notify {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    min-width: 0;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  body.lp { padding: clamp(36px, 8vh, 80px) 14px 40px; }
  .lp-shell { gap: 18px; max-width: 100%; }
  .lp-card { padding: 24px 20px; border-radius: 14px; min-height: 420px; }
  .lp-title { font-size: 24px; }
  .lp-logo { max-width: 170px; }
  .lp-modal { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-toggle-ink,
  .lp-submit,
  .lp-input,
  .lp-modal-backdrop,
  .lp-modal-card,
  .lp-notify,
  .lp-remember-switch,
  .lp-remember-knob {
    transition: none;
    animation: none;
  }
}
