/* ==========================================================================
   Prime Store — authentication & shared form components
   login · signup · forgot password · complete profile · account forms
   ========================================================================== */

.auth-page-shell, .auth-shell {
  min-height: 100svh;
  width: min(1180px, 100% - var(--gutter) * 2);
  margin: 0 auto;
  padding: calc(var(--header-h) + 48px) 0 64px;
  display: grid;
  align-items: center;
}
.auth-shell-narrow { width: min(1180px, 100% - var(--gutter) * 2); }
.auth-topbar, .profile-topbar { display: none !important; }

.px-auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  gap: clamp(24px, 4vw, 56px);
  align-items: stretch;
}
.auth-card-wrap:not(.px-auth-split), .auth-simple-wrap:not(.px-auth-split) { display: grid; justify-items: center; }

/* Brand panel */
.px-auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
  min-height: 560px;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(600px 380px at 20% 10%, rgba(139, 92, 246, 0.26), transparent 70%),
    radial-gradient(500px 300px at 90% 100%, rgba(109, 61, 240, 0.18), transparent 70%),
    var(--ink-1);
}
.px-auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 80%);
  mask-image: linear-gradient(180deg, #000, transparent 80%);
  animation: px-grid-pan 30s linear infinite;
}
@keyframes px-grid-pan { to { background-position: 40px 40px; } }
.px-auth-glyph {
  position: absolute;
  top: 6%;
  inset-inline-end: -4%;
  z-index: -1;
  font-family: var(--font-display);
  font-size: clamp(140px, 18vw, 260px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(180, 155, 255, 0.28);
  direction: ltr;
  animation: px-float 7s var(--ease-io) infinite;
}
.px-auth-logo { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.08), 0 20px 50px -20px var(--violet); margin-bottom: auto; }
.px-auth-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.px-auth-panel .px-kicker { text-transform: none; letter-spacing: 0.04em; direction: ltr; justify-content: flex-start; }
html[dir="rtl"] .px-auth-panel .px-kicker { font-family: var(--font-mono); font-size: 12px; direction: ltr; width: fit-content; }
.px-auth-panel h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 700; max-width: 460px; }
.px-auth-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.px-auth-points li { display: flex; align-items: center; gap: 14px; font-size: 14.5px; color: var(--text-2); }
.px-auth-points i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); color: var(--violet-hi); font-size: 13px; flex-shrink: 0; }

/* Card */
.auth-card {
  position: relative;
  width: 100%;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: clamp(24px, 3.4vw, 40px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%), rgba(12, 12, 17, 0.92);
  box-shadow: var(--shadow-2);
}
.auth-card-wrap:not(.px-auth-split) .auth-card, .auth-simple-wrap:not(.px-auth-split) .auth-card { max-width: 520px; }
.auth-card-head { display: grid; gap: 8px; }
.auth-card h1 { font-size: clamp(28px, 3vw, 36px); font-weight: 700; }
.auth-card h2 { font-size: 24px; font-weight: 700; }
.section-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-hi);
}
html[dir="rtl"] .section-label { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 13px; }
.muted-text { color: var(--text-2); font-size: 14.5px; }
.muted-text strong { color: var(--text); }

.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-button {
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.35s var(--ease-out), border-color 0.25s ease, background 0.25s ease;
}
.social-button i { font-size: 16px; }
.social-button.google i { background: conic-gradient(from -45deg, #ea4335 0 25%, #4285f4 0 50%, #34a853 0 75%, #fbbc05 0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.social-button.discord i { color: #8c96ff; }
.social-button:hover { transform: translateY(-2px); border-color: var(--line-3); background: rgba(255, 255, 255, 0.06); }
.social-button:active { transform: scale(0.97); }

.divider { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
html[dir="rtl"] .divider { font-family: var(--font-ar); letter-spacing: 0; font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.stack { display: grid; gap: 16px; }
.compact-stack { gap: 14px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--ink-0);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.field textarea { height: auto; min-height: 120px; padding: 14px 16px; }
.field input::placeholder { color: var(--text-3); }
.field input:hover { border-color: var(--line-3); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-a20); background: var(--ink-1); }
.field input[readonly] { color: var(--text-3); background: rgba(255, 255, 255, 0.02); border-style: dashed; cursor: not-allowed; }
.field input[inputmode="numeric"][maxlength="6"] { font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.5em; text-align: center; direction: ltr; }
.field small { font-size: 12.5px; color: var(--text-3); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.helper-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.helper-links a { color: var(--text); font-weight: 600; background: linear-gradient(var(--violet-hi), var(--violet-hi)) no-repeat 0 100% / 0 1px; transition: background-size 0.4s var(--ease-out), color 0.25s ease; }
html[dir="rtl"] .helper-links a { background-position: 100% 100%; }
.helper-links a:hover { color: var(--violet-hi); background-size: 100% 1px; }
.compact-links { justify-content: flex-end; }
.auth-card > .helper-links { justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--line); }

.auth-card-tools { display: flex; align-items: center; }
.remember-control { position: absolute; opacity: 0; pointer-events: none; }
.remember-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}
html[dir="rtl"] .remember-pill { padding: 0 6px 0 14px; }
.remember-pill .remember-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--ink-3); color: transparent; font-size: 13px; transition: background 0.3s ease, color 0.3s ease, transform 0.4s var(--ease-out); }
.remember-pill.active { color: var(--text); border-color: var(--violet-a35); background: var(--violet-a10); }
.remember-pill.active .remember-icon { background: var(--violet); color: #fff; transform: rotate(360deg); }

.submit-button {
  position: relative;
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 13px;
  background: var(--violet);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 18px 40px -16px var(--violet);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}
.submit-button::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease-out);
}
.submit-button:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 24px 48px -16px var(--violet); }
.submit-button:hover::after { transform: translateX(120%); }
.submit-button:active { transform: scale(0.98); }
.submit-button.ghost { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); box-shadow: none; color: var(--text); }
.submit-button.is-loading { pointer-events: none; color: transparent; }
.submit-button.is-loading::before { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: px-spin 0.7s linear infinite; }
@keyframes px-spin { to { transform: rotate(360deg); } }

.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-actions > * { flex: 1 1 auto; }
.inline-button {
  height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.3s var(--ease-out), color 0.25s ease;
}
.inline-button:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }
.inline-button.danger { color: var(--err); border-color: rgba(255, 107, 122, 0.3); }
.inline-button.danger:hover { background: var(--err-a); }
.compact-submit { height: 50px; }

.otp-box {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--violet-a35);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--violet-a10), transparent), var(--ink-1);
  animation: px-drop 0.6s var(--ease-out) both;
}
.compact-title { font-size: 19px !important; font-weight: 700; }
.mini-note { font-size: 12.5px; color: var(--text-3); max-width: 240px; }

/* Complete profile */
.auth-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(24px, 4vw, 56px); align-items: center; }
.auth-hero { display: grid; gap: 16px; }
.auth-badge { width: fit-content; height: 30px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--violet-a35); background: var(--violet-a10); color: var(--violet-hi); font-size: 12.5px; font-weight: 600; }
.auth-hero h1 { font-size: clamp(32px, 4.4vw, 54px); font-weight: 700; }
.auth-hero p { color: var(--text-2); font-size: 16px; max-width: 520px; }

@media (max-width: 960px) {
  .px-auth-split, .auth-grid { grid-template-columns: 1fr; }
  .px-auth-panel { min-height: 0; order: 2; padding: 24px; }
  .px-auth-glyph { font-size: 140px; }
  .px-auth-logo { width: 56px; height: 56px; }
  .auth-page-shell, .auth-shell { padding-top: calc(var(--header-h) + 24px); align-items: start; }
}
@media (max-width: 520px) {
  .field-grid { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 22px 18px; border-radius: var(--r-lg); }
  .px-auth-panel h2 { font-size: 22px; }
}
