/**
 * Portal v2 — Client auth design system
 * Login / register / forgot / set-password
 * Standalone. No app.css. Matches portal_v2 tokens.
 */

:root {
  --p2-ink: #2a2438;
  --p2-muted: #6b5f7a;
  --p2-line: rgba(91, 45, 122, 0.14);
  --p2-plum: #5b2d7a;
  --p2-plum-deep: #3d1a57;
  --p2-rose: #c45c8a;
  --p2-coral: #e56b6f;
  --p2-violet: #7c5cbf;
  --p2-peach: #ffb38a;
  --p2-mint: #5ec4b6;
  --p2-gold: #f0d48a;
  --p2-paper: #ffffff;
  --p2-bg: #faf6f3;
  --p2-font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --p2-display: "Fraunces", Georgia, "Times New Roman", serif;
  --p2-grad-primary: linear-gradient(135deg, #e56b6f 0%, #c45c8a 48%, #7c5cbf 100%);
  --p2-grad-hero: linear-gradient(155deg, #2a1538 0%, #3d1a57 28%, #5b2d7a 62%, #8b4578 100%);
  --p2-shadow-card: 0 30px 80px rgba(61, 26, 87, 0.18), 0 8px 24px rgba(61, 26, 87, 0.08);
  --p2-shadow-soft: 0 18px 48px rgba(61, 26, 87, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.p2-auth {
  margin: 0;
  min-height: 100vh;
  font-family: var(--p2-font);
  color: var(--p2-ink);
  background: var(--p2-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ----- Ambient stage ----- */
.p2-auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 8% 12%, rgba(229, 107, 111, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 92% 8%, rgba(124, 92, 191, 0.2), transparent 50%),
    radial-gradient(ellipse 60% 45% at 70% 95%, rgba(94, 196, 182, 0.12), transparent 45%),
    radial-gradient(ellipse 50% 40% at 20% 85%, rgba(240, 212, 138, 0.1), transparent 50%),
    linear-gradient(160deg, #faf6f3 0%, #f4eef9 42%, #efe8f6 100%);
}

.p2-auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(91, 45, 122, 0.22), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(229, 107, 111, 0.2), transparent),
    radial-gradient(1.4px 1.4px at 48% 30%, rgba(124, 92, 191, 0.18), transparent),
    radial-gradient(1px 1px at 72% 78%, rgba(94, 196, 182, 0.22), transparent),
    radial-gradient(1.2px 1.2px at 88% 22%, rgba(240, 212, 138, 0.28), transparent),
    radial-gradient(1px 1px at 8% 88%, rgba(124, 92, 191, 0.16), transparent);
}

.p2-auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: p2-auth-float 14s ease-in-out infinite;
}

.p2-auth-orb-a {
  width: 280px;
  height: 280px;
  left: -60px;
  top: 18%;
  background: radial-gradient(circle, rgba(229, 107, 111, 0.45), transparent 70%);
}

.p2-auth-orb-b {
  width: 340px;
  height: 340px;
  right: -80px;
  top: -40px;
  background: radial-gradient(circle, rgba(124, 92, 191, 0.4), transparent 70%);
  animation-delay: -4s;
}

.p2-auth-orb-c {
  width: 220px;
  height: 220px;
  right: 18%;
  bottom: 4%;
  background: radial-gradient(circle, rgba(94, 196, 182, 0.35), transparent 70%);
  animation-delay: -7s;
}

@keyframes p2-auth-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(12px, -18px, 0) scale(1.05); }
}

/* ----- Frame ----- */
.p2-auth-frame {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(20px, 4vh, 48px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 440px);
  gap: clamp(18px, 3vw, 32px);
  align-items: center;
}

.p2-auth-frame.is-single {
  grid-template-columns: minmax(0, 480px);
  justify-content: center;
}

.p2-auth-frame > .jkb-link-change-notice {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--p2-line);
  box-shadow: var(--p2-shadow-soft);
  font-size: 0.92rem;
}

/* ----- Story / hero panel ----- */
.p2-auth-story {
  position: relative;
  min-height: min(640px, calc(100vh - 64px));
  padding: clamp(28px, 4.5vw, 52px);
  border-radius: 36px;
  color: #fff;
  overflow: hidden;
  background: var(--p2-grad-hero);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 40px 90px rgba(42, 21, 56, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.p2-auth-story::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 92% 8%, rgba(240, 212, 138, 0.32), transparent 34%),
    radial-gradient(circle at 6% 88%, rgba(229, 107, 111, 0.3), transparent 36%),
    radial-gradient(circle at 48% 48%, rgba(124, 92, 191, 0.18), transparent 42%);
  pointer-events: none;
}

.p2-auth-story::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -70px;
  bottom: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 179, 138, 0.22), transparent 68%);
  pointer-events: none;
}

.p2-auth-story > * {
  position: relative;
  z-index: 1;
}

.p2-auth-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.p2-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.p2-auth-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p2-gold);
  box-shadow: 0 0 0 4px rgba(240, 212, 138, 0.22);
  font-style: normal;
}

.p2-auth-secure {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.82;
  letter-spacing: 0.02em;
}

.p2-auth-story h1 {
  margin: 18px 0 14px;
  font-family: var(--p2-display);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 11ch;
  text-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.p2-auth-story .p2-auth-lead {
  margin: 0;
  max-width: 36ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.p2-auth-steps {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.p2-auth-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.p2-auth-steps b {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 179, 138, 0.95), rgba(240, 212, 138, 0.9));
  color: #3d1a57;
  font-size: 0.85rem;
  font-weight: 800;
}

.p2-auth-steps strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 750;
  margin-bottom: 2px;
}

.p2-auth-steps span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.p2-auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.p2-auth-feature-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ----- Form panel ----- */
.p2-auth-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.p2-auth-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  padding: clamp(26px, 3.5vw, 38px);
  border-radius: 32px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(250, 246, 243, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--p2-shadow-card);
  backdrop-filter: blur(18px);
}

.p2-auth-card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--p2-grad-primary);
  opacity: 0.95;
}

.p2-auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
}

.p2-auth-logo img {
  display: block;
  max-width: 118px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.p2-auth-logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--p2-peach), #e0a84a 55%, var(--p2-mint));
  box-shadow: 0 10px 22px rgba(61, 26, 87, 0.16);
  flex: 0 0 auto;
}

.p2-auth-kicker {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(91, 45, 122, 0.08);
  border: 1px solid rgba(124, 92, 191, 0.18);
  color: var(--p2-plum);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.p2-auth-card h1,
.p2-auth-card h2 {
  margin: 0 0 8px;
  font-family: var(--p2-display);
  font-size: clamp(1.85rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--p2-ink);
}

.p2-auth-sub {
  margin: 0 0 18px;
  color: var(--p2-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.p2-auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.p2-auth-field label {
  font-size: 0.82rem;
  font-weight: 750;
  color: #3a3348;
}

.p2-auth-field input,
.p2-auth-field select,
.p2-auth-field textarea {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid rgba(91, 45, 122, 0.15);
  background: #fff;
  color: var(--p2-ink);
  padding: 0 16px;
  font: inherit;
  font-size: 0.98rem;
  box-shadow: 0 1px 0 rgba(61, 26, 87, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.p2-auth-field textarea {
  min-height: 100px;
  padding: 12px 16px;
  resize: vertical;
}

.p2-auth-field input:hover,
.p2-auth-field select:hover,
.p2-auth-field textarea:hover {
  border-color: rgba(124, 92, 191, 0.35);
}

.p2-auth-field input:focus,
.p2-auth-field select:focus,
.p2-auth-field textarea:focus {
  outline: none;
  border-color: rgba(124, 92, 191, 0.55);
  box-shadow: 0 0 0 4px rgba(124, 92, 191, 0.14);
}

.p2-auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.p2-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  background: var(--p2-grad-primary);
  box-shadow: 0 16px 34px rgba(124, 92, 191, 0.3);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.p2-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(124, 92, 191, 0.36);
  filter: brightness(1.03);
}

.p2-auth-submit:active {
  transform: translateY(0);
}

.p2-auth-submit.secondary {
  background: #fff;
  color: var(--p2-plum);
  border: 1px solid rgba(91, 45, 122, 0.18);
  box-shadow: none;
  margin-top: 10px;
}

.p2-auth-submit.secondary:hover {
  box-shadow: 0 8px 20px rgba(61, 26, 87, 0.08);
  filter: none;
}

.p2-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 18px;
}

.p2-auth-links a {
  color: var(--p2-plum);
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
}

.p2-auth-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.p2-auth-note {
  margin: 16px 0 0;
  color: var(--p2-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.p2-auth-foot {
  text-align: center;
  font-size: 0.8rem;
  color: var(--p2-muted);
  padding: 4px 8px 0;
}

.p2-auth-foot strong {
  color: var(--p2-plum);
  font-weight: 750;
}

/* Alerts */
.p2-auth-alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 600;
}

.p2-auth-alert-error {
  background: #fff5f5;
  border: 1px solid rgba(229, 107, 111, 0.35);
  color: #8b2e2e;
}

.p2-auth-alert-warn {
  background: #fff9ed;
  border: 1px solid rgba(240, 212, 138, 0.55);
  color: #6b4e16;
}

.p2-auth-alert-ok {
  background: #eefaf6;
  border: 1px solid rgba(94, 196, 182, 0.4);
  color: #1f6f66;
}

.p2-auth-alert-info {
  background: rgba(91, 45, 122, 0.06);
  border: 1px solid rgba(91, 45, 122, 0.12);
  color: #3a3348;
}

/* Register plan cards */
.p2-auth-plans {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
}

.p2-auth-plan {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 2px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(91, 45, 122, 0.14);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.p2-auth-plan input {
  grid-row: 1 / span 3;
  align-self: center;
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--p2-plum);
}

.p2-auth-plan span {
  font-weight: 800;
  font-size: 0.95rem;
}

.p2-auth-plan strong {
  color: var(--p2-plum);
  font-size: 0.9rem;
}

.p2-auth-plan small,
.p2-auth-plan em {
  grid-column: 2;
  color: var(--p2-muted);
  font-size: 0.8rem;
  font-style: normal;
}

.p2-auth-plan.is-selected,
.p2-auth-plan:has(input:checked) {
  border-color: rgba(124, 92, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 92, 191, 0.12);
  background: linear-gradient(180deg, #fbf7ff, #fff);
}

/* Honeypot */
.p2-auth-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Motion reduce */
@media (prefers-reduced-motion: reduce) {
  .p2-auth-orb { animation: none; }
  .p2-auth-submit { transition: none; }
}

/* Responsive */
@media (max-width: 960px) {
  .p2-auth-frame {
    width: min(520px, calc(100vw - 24px));
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 20px 0 36px;
  }

  .p2-auth-story {
    min-height: auto;
    padding: 26px 22px;
    border-radius: 28px;
  }

  .p2-auth-story h1 {
    max-width: none;
    font-size: clamp(2.1rem, 9vw, 2.7rem);
  }

  .p2-auth-steps { margin-top: 20px; }
}

@media (max-width: 560px) {
  .p2-auth-frame {
    width: calc(100vw - 16px);
    gap: 12px;
  }

  .p2-auth-story,
  .p2-auth-card {
    border-radius: 24px;
    padding: 22px 18px;
  }

  .p2-auth-grid-2 {
    grid-template-columns: 1fr;
  }

  .p2-auth-brand-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* auth-fix-date */

/* auth-fix-+%s */
