/* ============================================================
   PakAutoMart APEX — glossy auth (signin/signup)
   Split layout: animated visual panel + glass form card.
   ============================================================ */

.apx-auth {
  position: relative; min-height: 100vh; display: flex;
  background: #07090d; color: #f4f6f9; overflow: hidden;
  font-family: 'Barlow', 'Public Sans', system-ui, sans-serif;
}
/* animated backdrop */
.apx-auth__bgwrap { position: absolute; inset: 0; overflow: hidden; }
.apx-auth__bgwrap img {
  width: 100%; height: 100%; object-fit: cover;
  animation: apx-kenburns 26s ease-in-out infinite alternate;
}
.apx-auth__shade {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(7,9,13,0.88) 0%, rgba(7,9,13,0.55) 45%, rgba(7,9,13,0.75) 100%);
}
.apx-auth__sweep {
  position: absolute; top: -20%; bottom: -20%; width: 30%; left: -40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.10), transparent);
  transform: skewX(-12deg); pointer-events: none;
  animation: apx-sweep 11s ease-in-out infinite;
}
.apx-auth .apx-orb { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; animation: apx-drift 12s ease-in-out infinite alternate; }
.apx-auth .apx-orb--r { width: 380px; height: 380px; background: radial-gradient(circle, rgba(225,6,0,0.30), transparent 65%); }
.apx-auth .apx-orb--w { width: 300px; height: 300px; background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 65%); animation-delay: -6s; }

.apx-auth__back {
  position: absolute; top: 24px; left: 24px; z-index: 5;
  color: #cfd6e2; text-decoration: none; font-size: 13.5px; font-weight: 600;
  display: inline-flex; gap: 8px; align-items: center;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  padding: 9px 18px; border-radius: 30px; backdrop-filter: blur(10px);
}
.apx-auth__back:hover { color: #fff; border-color: rgba(225,6,0,0.5); }

.apx-auth__wrap {
  position: relative; z-index: 4; width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
  padding: 90px 32px 48px;
}

/* left copy */
.apx-auth__eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase;
  color: #ff8a86; background: rgba(225,6,0,0.14); border: 1px solid rgba(225,6,0,0.4);
  padding: 8px 18px; border-radius: 30px; margin-bottom: 20px;
}
.apx-auth__copy h1 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: clamp(44px, 5.5vw, 76px); line-height: 0.95; letter-spacing: 1px; margin: 0 0 16px;
}
.apx-auth__copy h1 span {
  background: linear-gradient(180deg, #ff6a5e, #e10600 60%, #8f0400);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.apx-auth__copy > p { color: #9aa3b2; font-size: 15.5px; max-width: 460px; margin: 0 0 30px; line-height: 1.65; }
.apx-auth__points { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.apx-apoint {
  display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02) 60%);
  border: 1px solid rgba(255,255,255,0.10); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.apx-apoint__dot {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
  background: rgba(225,6,0,0.14); border: 1px solid rgba(225,6,0,0.35);
  display: flex; align-items: center; justify-content: center; color: #ff6a5e;
}
.apx-apoint__dot svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.apx-apoint b { display: block; font-size: 14.5px; font-weight: 800; }
.apx-apoint span { font-size: 12.5px; color: #9aa3b2; }

/* right form card */
.apx-auth__formcard {
  border-radius: 22px; padding: 38px 36px;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.025) 60%), rgba(16,18,24,0.72);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 30px 80px rgba(0,0,0,0.55);
  animation: apx-fadein 0.6s ease both;
}
.apx-auth__formcard h2 {
  font-family: 'Barlow Condensed', sans-serif; font-size: 34px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; margin: 0 0 6px;
}
.apx-auth__formcard > p { color: #9aa3b2; font-size: 14px; margin: 0 0 24px; }
.apx-auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.apx-auth__brand img { height: 40px; width: auto; }

.apx-field { margin-bottom: 16px; }
.apx-field label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #9aa3b2; margin-bottom: 8px; }
.apx-field input[type="text"], .apx-field input[type="email"], .apx-field input[type="tel"], .apx-field input[type="password"] {
  width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 11px; padding: 13px 16px; color: #fff; font-size: 14.5px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.apx-field input:focus {
  border-color: #e10600; box-shadow: 0 0 0 3px rgba(225,6,0,0.22), 0 0 24px rgba(225,6,0,0.15);
  background: rgba(255,255,255,0.08);
}
.apx-field input::placeholder { color: #5d6675; }
.apx-field .is-invalid { border-color: #e10600 !important; }
.apx-field .invalid-feedback { color: #ff8a86; font-size: 12.5px; font-weight: 600; margin-top: 6px; display: block; }
.apx-field__wrap { position: relative; }
.apx-field__wrap .password-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #9aa3b2; cursor: pointer; font-size: 20px; }
.apx-field__wrap .password-toggle:hover { color: #fff; }

.apx-form__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; font-size: 13px; }
.apx-form__row label { display: inline-flex; align-items: center; gap: 8px; color: #9aa3b2; font-weight: 600; cursor: pointer; }
.apx-form__row input[type="checkbox"] { accent-color: #e10600; width: 16px; height: 16px; }
.apx-form__row a { color: #cfd6e2; font-weight: 700; text-decoration: none; }
.apx-form__row a:hover { color: #fff; text-decoration: underline; }

.apx-auth__submit {
  width: 100%; position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #f41a14, #e10600 55%, #a80400);
  color: #fff; border: none; border-radius: 12px; padding: 15px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  box-shadow: 0 10px 30px rgba(225,6,0,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.apx-auth__submit:hover { transform: translateY(-1px); box-shadow: 0 14px 38px rgba(225,6,0,0.5), inset 0 1px 0 rgba(255,255,255,0.25); }
.apx-auth__submit::after {
  content: ""; position: absolute; top: -25%; bottom: -25%; width: 35%; left: -45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-18deg); pointer-events: none;
}
.apx-auth__submit:hover::after { animation: apx-sheen 0.85s ease; }
.apx-auth__submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.apx-auth__divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0;
  color: #5d6675; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.apx-auth__divider::before, .apx-auth__divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.10); }
.apx-auth__social { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 6px; }
.apx-auth__social a {
  display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 11px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: #cfd6e2; font-size: 19px; text-decoration: none; transition: all 0.15s ease;
}
.apx-auth__social a:hover { border-color: #e10600; color: #fff; transform: translateY(-2px); }
.apx-auth__switch { text-align: center; margin-top: 20px; font-size: 13.5px; color: #9aa3b2; }
.apx-auth__switch a { color: #ff6a5e; font-weight: 800; text-decoration: none; }
.apx-auth__switch a:hover { text-decoration: underline; }
.apx-auth__terms { font-size: 12.5px; color: #9aa3b2; margin-bottom: 18px; }
.apx-auth__terms a { color: #ff6a5e; font-weight: 700; }
.apx-auth__terms input[type="checkbox"] { accent-color: #e10600; }

@keyframes apx-kenburns { from { transform: scale(1) translate(0,0); } to { transform: scale(1.12) translate(-1.5%,1%); } }
@keyframes apx-sheen { 0% { left: -45%; } 100% { left: 135%; } }
@keyframes apx-sweep { 0% { left: -40%; } 55% { left: 130%; } 100% { left: 130%; } }
@keyframes apx-drift { from { transform: translate(0,0); } to { transform: translate(-46px,34px); } }
@keyframes apx-fadein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 960px) {
  .apx-auth__wrap { grid-template-columns: 1fr; gap: 32px; padding: 80px 20px 40px; }
  .apx-auth__copy { text-align: center; }
  .apx-auth__copy > p, .apx-auth__points { margin-left: auto; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .apx-auth__bgwrap img, .apx-auth__sweep, .apx-auth .apx-orb, .apx-auth__submit::after { animation: none !important; }
}

/* Back to Home + Back to Previous stacked */
.apx-auth__home { background: rgba(225,6,0,.14); border-color: rgba(225,6,0,.45); color: #fff; }
.apx-auth__home:hover { background: rgba(225,6,0,.28); border-color: #e10600; color: #fff; }
.apx-auth__back:not(.apx-auth__home) { top: 76px; }
.apx-auth__brand { display: inline-block; cursor: pointer; transition: transform .25s ease; }
.apx-auth__brand:hover { transform: scale(1.06); }

/* Back buttons: stacked, no overlap */
.apx-auth__home { position: absolute !important; top: 24px !important; left: 24px !important; z-index: 6 !important; }
.apx-auth__prev { position: absolute !important; top: 78px !important; left: 24px !important; z-index: 5 !important; }
