/**
 * Profit Alerts — auth pages redesign (login / register / forgot).
 * Split layout: brand signal panel (desktop) + form column.
 * Mobile-first: 16px inputs (no iOS zoom), 52px tap targets, staggered entrances.
 * v20260611
 */

.pa-auth2 {
  --a2-bg: #060912;
  --a2-text: #e2eaf6;
  --a2-muted: #5a7090;
  --a2-teal: #0ea5e9;
  --a2-green: #10b981;
  --a2-red: #f43f5e;
  --a2-border: rgba(255, 255, 255, 0.09);
  --a2-ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: calc(100dvh - 5rem);
  font-size: 16px;
}

/* ════════════════════════════════════════════════════
   LEFT — brand signal panel (desktop only)
   ════════════════════════════════════════════════════ */
.pa-auth2__panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem clamp(2rem, 5vw, 4.5rem);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(14, 165, 233, 0.09), transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 90%, rgba(16, 185, 129, 0.06), transparent 60%);
  overflow: hidden;
}

.pa-auth2__panel-inner {
  width: 100%;
  max-width: 26.5rem;
}

.pa-auth2__panel-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(14, 165, 233, 0.85);
  animation: a2FadeUp 0.6s var(--a2-ease) both 0.05s;
}

.pa-auth2__panel-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a2-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: a2Pulse 2.4s ease-in-out infinite;
}

.pa-auth2__panel-title {
  margin: 0 0 0.9rem;
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--a2-text);
  animation: a2FadeUp 0.65s var(--a2-ease) both 0.12s;
}

.pa-auth2__panel-title em {
  font-style: normal;
  color: var(--a2-teal);
}

.pa-auth2__panel-sub {
  margin: 0 0 2.25rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--a2-muted);
  max-width: 24rem;
  animation: a2FadeUp 0.65s var(--a2-ease) both 0.18s;
}

/* ── stacked signal cards ── */
.pa-auth2__cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 2.25rem;
}

.pa-auth2__card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--a2-border);
  animation: a2SlideIn 0.7s var(--a2-ease) both;
}

.pa-auth2__card:nth-child(1) { animation-delay: 0.28s; }
.pa-auth2__card:nth-child(2) { animation-delay: 0.42s; opacity: 0.85; }
.pa-auth2__card:nth-child(3) { animation-delay: 0.56s; opacity: 0.65; }

.pa-auth2__card--bull { border-color: rgba(16, 185, 129, 0.28); }
.pa-auth2__card--bear { border-color: rgba(244, 63, 94, 0.24); }

.pa-auth2__card-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pa-auth2__card--bull .pa-auth2__card-icon {
  background: rgba(16, 185, 129, 0.13);
  color: #34d399;
}

.pa-auth2__card--bear .pa-auth2__card-icon {
  background: rgba(244, 63, 94, 0.11);
  color: #fb7185;
}

.pa-auth2__card-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(226, 234, 246, 0.92);
  line-height: 1.35;
}

.pa-auth2__card-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--a2-muted);
  margin-top: 2px;
}

.pa-auth2__card-pct {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pa-auth2__card--bull .pa-auth2__card-pct { color: #34d399; }
.pa-auth2__card--bear .pa-auth2__card-pct { color: #fb7185; }

/* ── value points ── */
.pa-auth2__points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
  animation: a2FadeUp 0.6s var(--a2-ease) both 0.66s;
}

.pa-auth2__points li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: rgba(226, 234, 246, 0.6);
}

.pa-auth2__points svg {
  flex-shrink: 0;
  color: var(--a2-green);
}

.pa-auth2__panel-note {
  margin: 2.25rem 0 0;
  font-size: 0.7rem;
  line-height: 1.55;
  color: rgba(90, 112, 144, 0.7);
  animation: a2FadeUp 0.6s var(--a2-ease) both 0.74s;
}

/* ════════════════════════════════════════════════════
   RIGHT — form column
   ════════════════════════════════════════════════════ */
.pa-auth2__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
}

.pa-auth2__box {
  width: 100%;
  max-width: 26.5rem;
  animation: a2FadeUp 0.55s var(--a2-ease) both 0.1s;
}

.pa-auth2__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 4.5vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--a2-text);
}

.pa-auth2__sub {
  margin: 0 0 1.9rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--a2-muted);
}

/* ── flash messages ── */
.pa-auth2__flash {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.95rem;
  border-radius: 11px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.35rem;
  animation: a2FadeUp 0.4s var(--a2-ease) both;
}

.pa-auth2__flash svg { flex-shrink: 0; margin-top: 2px; }

.pa-auth2__flash--error {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.28);
  color: #fda4af;
}

.pa-auth2__flash--success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
}

/* ── fields ── */
.pa-auth2__field {
  margin-bottom: 1.1rem;
  animation: a2FadeUp 0.5s var(--a2-ease) both;
}

.pa-auth2__field:nth-of-type(1) { animation-delay: 0.18s; }
.pa-auth2__field:nth-of-type(2) { animation-delay: 0.26s; }
.pa-auth2__field:nth-of-type(3) { animation-delay: 0.34s; }

.pa-auth2__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(226, 234, 246, 0.72);
  margin-bottom: 0.45rem;
}

.pa-auth2__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pa-auth2__input-icon {
  position: absolute;
  left: 0.95rem;
  display: flex;
  align-items: center;
  color: rgba(226, 234, 246, 0.3);
  pointer-events: none;
  transition: color 0.18s;
}

.pa-auth2__input {
  width: 100%;
  height: 52px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  color: var(--a2-text);
  font-size: 1rem; /* 16px — prevents iOS auto-zoom */
  font-family: inherit;
  padding: 0 1rem 0 2.8rem;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.pa-auth2__input::placeholder { color: rgba(226, 234, 246, 0.26); }

.pa-auth2__input:focus {
  background: rgba(14, 165, 233, 0.05);
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.pa-auth2__input-wrap:focus-within .pa-auth2__input-icon { color: var(--a2-teal); }

.pa-auth2__input--pass { padding-right: 3.2rem; }

.pa-auth2__pass-toggle {
  position: absolute;
  right: 0;
  width: 48px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(226, 234, 246, 0.32);
  cursor: pointer;
  border-radius: 0 12px 12px 0;
  transition: color 0.15s;
}

.pa-auth2__pass-toggle:hover { color: rgba(226, 234, 246, 0.75); }

.pa-auth2__pass-toggle:focus-visible {
  outline: 2px solid rgba(14, 165, 233, 0.6);
  outline-offset: -2px;
}

.pa-auth2__forgot {
  display: inline-block;
  font-size: 0.8rem;
  color: rgba(226, 234, 246, 0.42);
  text-decoration: none;
  margin-top: 0.5rem;
  transition: color 0.15s;
}

.pa-auth2__forgot:hover { color: var(--a2-teal); }

.pa-auth2__row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ── password strength ── */
.pa-auth2__strength { margin-top: 0.55rem; }

.pa-auth2__strength-bar {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.pa-auth2__strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.35s var(--a2-ease), background 0.35s ease;
}

.pa-auth2__strength-label {
  font-size: 0.72rem;
  color: rgba(226, 234, 246, 0.32);
  margin: 0.3rem 0 0;
  min-height: 1em;
}

/* ── submit ── */
.pa-auth2__submit {
  width: 100%;
  height: 52px;
  margin-top: 0.85rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(14, 165, 233, 0.45);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(139, 92, 246, 0.16));
  color: #d6efff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(14, 165, 233, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: box-shadow 0.22s, border-color 0.22s, background 0.22s, transform 0.15s;
  animation: a2FadeUp 0.5s var(--a2-ease) both 0.42s;
}

.pa-auth2__submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.14) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
}

.pa-auth2__submit:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.32), rgba(139, 92, 246, 0.24));
  border-color: rgba(14, 165, 233, 0.65);
  box-shadow: 0 0 44px rgba(14, 165, 233, 0.22), 0 10px 32px rgba(0, 0, 0, 0.3);
}

.pa-auth2__submit:hover::before { transform: translateX(100%); }
.pa-auth2__submit:active { transform: scale(0.985); }

.pa-auth2__submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* loading state — JS adds .is-loading on submit */
.pa-auth2__submit .pa-auth2__spinner {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.pa-auth2__submit.is-loading { color: transparent; pointer-events: none; }
.pa-auth2__submit.is-loading .pa-auth2__spinner { display: flex; }

.pa-auth2__spinner::after {
  content: "";
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid rgba(214, 239, 255, 0.25);
  border-top-color: #d6efff;
  animation: a2Spin 0.7s linear infinite;
}

@keyframes a2Spin { to { transform: rotate(360deg); } }

/* ── below-form bits ── */
.pa-auth2__terms {
  font-size: 0.74rem;
  color: rgba(226, 234, 246, 0.3);
  text-align: center;
  margin: 1.1rem 0 0;
  line-height: 1.6;
}

.pa-auth2__terms a {
  color: rgba(14, 165, 233, 0.75);
  text-decoration: none;
}

.pa-auth2__terms a:hover { color: var(--a2-teal); text-decoration: underline; }

.pa-auth2__switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: rgba(226, 234, 246, 0.42);
  animation: a2FadeUp 0.5s var(--a2-ease) both 0.5s;
}

.pa-auth2__switch a {
  color: var(--a2-teal);
  font-weight: 700;
  text-decoration: none;
  margin-left: 0.3rem;
}

.pa-auth2__switch a:hover { text-decoration: underline; }

.pa-auth2__features {
  display: flex;
  justify-content: center;
  gap: 1.35rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  animation: a2FadeUp 0.5s var(--a2-ease) both 0.58s;
}

.pa-auth2__feature {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  color: rgba(226, 234, 246, 0.35);
}

.pa-auth2__feature svg { color: rgba(14, 165, 233, 0.55); }

/* footer */
.pa-auth2-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.25rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: rgba(226, 234, 246, 0.24);
}

.pa-auth2-footer a {
  color: rgba(226, 234, 246, 0.34);
  text-decoration: none;
  margin: 0 0.4rem;
  transition: color 0.15s;
}

.pa-auth2-footer a:hover { color: var(--a2-teal); }

/* ════════════════════════════════════════════════════
   LIVE FEED ROTATION — auth panel signal cards
   (JS adds .pa-cycle-live on first rotation, then FLIPs)
   ════════════════════════════════════════════════════ */
.pa-cycle-live .pa-auth2__card {
  /* entrance already played; DOM moves must not replay it */
  animation: none !important;
}

/* must out-rank `.pa-cycle-live .pa-auth2__card { animation: none }` */
.pa-cycle-live .pa-auth2__card.pa-cycle-in,
.pa-cycle-in {
  animation: paCycleIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes paCycleIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.97); }
}

/* ════════════════════════════════════════════════════
   SINGLE-COLUMN VARIANT — forgot / reset password
   ════════════════════════════════════════════════════ */
.pa-auth2--single { grid-template-columns: 1fr; }
.pa-auth2--single .pa-auth2__panel { display: none; }
.pa-auth2--single .pa-auth2__main { padding: 2.5rem 1.1rem 3rem; }

.pa-auth2__icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--a2-teal);
  margin: 0 auto 1.4rem;
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.1);
  animation: a2FadeUp 0.5s var(--a2-ease) both 0.04s;
}

.pa-auth2__title--center,
.pa-auth2__sub--center { text-align: center; }

.pa-auth2__back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.4rem;
  font-size: 0.85rem;
  color: rgba(226, 234, 246, 0.4);
  text-decoration: none;
  transition: color 0.15s;
  animation: a2FadeUp 0.5s var(--a2-ease) both 0.5s;
}

.pa-auth2__back:hover { color: var(--a2-teal); }

/* invalid-token state */
.pa-auth2__dead {
  text-align: center;
  animation: a2FadeUp 0.5s var(--a2-ease) both 0.15s;
}

.pa-auth2__dead-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgba(244, 63, 94, 0.09);
  border: 1px solid rgba(244, 63, 94, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fb7185;
  margin: 0 auto 1.25rem;
}

.pa-auth2__dead-text {
  font-size: 0.95rem;
  color: var(--a2-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

/* ════════════════════════════════════════════════════
   KEYFRAMES
   ════════════════════════════════════════════════════ */
@keyframes a2FadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes a2SlideIn {
  from { opacity: 0; transform: translateX(-22px); }
}

@keyframes a2Pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.75); }
}

/* card 2 and 3 keep their resting opacity after the entrance */
@keyframes a2SlideIn85 {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 0.85; transform: translateX(0); }
}

@keyframes a2SlideIn65 {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 0.65; transform: translateX(0); }
}

.pa-auth2__card:nth-child(2) { animation-name: a2SlideIn85; }
.pa-auth2__card:nth-child(3) { animation-name: a2SlideIn65; }

/* ════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .pa-auth2 { grid-template-columns: 1fr; }
  .pa-auth2__panel { display: none; }
  .pa-auth2__main { padding: 2rem 1.1rem 2.75rem; }
}

@media (max-width: 480px) {
  .pa-auth2__main { padding: 1.5rem 1rem 2.25rem; }
  .pa-auth2__sub { margin-bottom: 1.5rem; }
  .pa-auth2__features { gap: 0.9rem 1.1rem; }
}

/* ════════════════════════════════════════════════════
   REDUCED MOTION
   ════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .pa-auth2 *,
  .pa-auth2__box,
  .pa-auth2__card,
  .pa-auth2__submit {
    animation: none !important;
  }
  .pa-auth2__card:nth-child(2) { opacity: 0.85; }
  .pa-auth2__card:nth-child(3) { opacity: 0.65; }
  .pa-auth2__spinner::after { animation: a2Spin 0.7s linear infinite !important; }
}
