/* =========================================================
   NextShop.bg — Auth (login / register)
   Split-screen layout, floating labels, password strength
   ========================================================= */

body.auth-body { background: var(--off); overflow-x: hidden; }

.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

/* ============ BRAND PANEL ============ */
.auth-brand {
  position: relative; overflow: hidden; color: #fff;
  padding: 44px 48px; display: flex; flex-direction: column; gap: 32px;
  background: linear-gradient(135deg, #1c1c28 0%, #2a1f4a 55%, #3b1d5e 100%);
  isolation: isolate;
}
.auth-brand-bg { position: absolute; inset: 0; z-index: -1; }
.auth-brand-bg .blob { opacity: .55; }
.auth-brand-bg .blob-1 { width: 480px; height: 480px; top: -120px; left: -100px; background: radial-gradient(circle, #a78bfa, transparent 70%); animation: float1 18s ease-in-out infinite; }
.auth-brand-bg .blob-2 { width: 420px; height: 420px; bottom: -140px; right: -100px; background: radial-gradient(circle, #f0abfc, transparent 70%); animation: float2 22s ease-in-out infinite; }
.auth-brand-bg .grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000, transparent 80%);
}

.auth-logo {
  display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px;
  color: #fff; font-family: var(--font-display); letter-spacing: -.5px; width: fit-content;
}
.auth-logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--violet-mid), var(--violet-light));
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(124,58,237,.5);
}
.auth-logo-mark svg { width: 18px; height: 18px; fill: #fff; }
.auth-logo-dot { color: var(--violet-glow); }

.auth-brand-content { margin-top: auto; position: relative; }
.auth-brand-content h2 {
  color: #fff; font-size: clamp(26px, 3vw, 38px); font-weight: 800;
  letter-spacing: -.025em; line-height: 1.15; margin-bottom: 14px;
}
.auth-brand-content h2 .grad-text { display: inline; }
.auth-brand-content > p { color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.7; max-width: 420px; }

/* Floating live-order card on brand panel */
.auth-float-card {
  margin-top: 28px; background: rgba(255,255,255,.08); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 18px 20px;
  max-width: 320px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: floatY 5s ease-in-out infinite;
}
.auth-float-card .af-ic { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--emerald-light), var(--emerald)); display: grid; place-items: center; flex-shrink: 0; }
.auth-float-card .af-ic i { color: #fff; font-size: 22px; }
.auth-float-card b { display: block; color: #fff; font-size: 14px; }
.auth-float-card small { color: rgba(255,255,255,.6); font-size: 12px; }
.auth-float-card .af-pulse { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-light); box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: pulse 1.8s infinite; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.auth-brand-foot { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; color: rgba(255,255,255,.5); font-size: 12.5px; }
.auth-brand-foot span { display: inline-flex; align-items: center; gap: 6px; }
.auth-brand-foot i { color: var(--violet-glow); font-size: 16px; }
.auth-brand-foot .avatars { display: flex; }
.auth-brand-foot .avatars span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #1c1c28; margin-left: -8px; font-size: 10px; font-weight: 700; display: grid; place-items: center; color: #fff; }
.auth-brand-foot .avatars span:first-child { margin-left: 0; }

/* ============ FORM PANEL ============ */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.auth-top-bar { position: absolute; top: 24px; right: 28px; display: flex; gap: 10px; align-items: center; }
.auth-top-bar a { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; transition: color .2s; }
.auth-top-bar a:hover { color: var(--violet-mid); }

.auth-card { width: 100%; max-width: 440px; }
.auth-card-head { margin-bottom: 30px; }
.auth-card-head h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -.025em; margin-bottom: 8px; font-family: var(--font-display); }
.auth-card-head p { color: var(--muted); font-size: 15px; }
.auth-card-head p a { color: var(--violet-mid); font-weight: 600; text-decoration: none; }
.auth-card-head p a:hover { text-decoration: underline; }

/* Mobile logo (hidden on desktop) */
.auth-mobile-logo { display: none; margin-bottom: 24px; }
.auth-mobile-logo { color: var(--ink); }
.auth-mobile-logo .auth-logo-dot { color: var(--violet-mid); }

/* ============ SOCIAL BUTTONS ============ */
.auth-social { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.auth-social-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 11px; border: 1.5px solid var(--border2);
  background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600;
  font-family: inherit; transition: all .2s; cursor: pointer;
}
.auth-social-btn:hover { border-color: var(--violet-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.auth-social-btn i { font-size: 18px; }
.auth-social-btn .ti-brand-google { color: #ea4335; }

.auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--faint); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ============ FIELDS (floating labels) ============ */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { position: relative; }
.field-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 18px; pointer-events: none; transition: color .2s; z-index: 2;
}
.field input {
  width: 100%; padding: 21px 46px 9px 46px; border-radius: 12px;
  border: 1.5px solid var(--border2); background: var(--white); color: var(--ink);
  font-size: 15px; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: transparent; }
.field input:hover { border-color: var(--border-strong); }
.field input:focus { outline: none; border-color: var(--violet-light); box-shadow: 0 0 0 4px var(--violet-faint); }
.field:focus-within .field-icon { color: var(--violet-mid); }

.field label {
  position: absolute; left: 46px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 15px; pointer-events: none;
  transition: all .18s cubic-bezier(.4,0,.2,1); background: transparent;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 13px; transform: translateY(0); font-size: 11px; font-weight: 600;
  color: var(--violet-mid); letter-spacing: .3px;
}

/* Password toggle */
.field-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: none; color: var(--faint);
  display: grid; place-items: center; cursor: pointer; border-radius: 8px; font-size: 18px; z-index: 3;
  transition: color .2s, background .2s;
}
.field-toggle:hover { color: var(--violet-mid); background: var(--soft); }

/* Validity states */
.field.valid input { border-color: var(--emerald); }
.field.valid input:focus { box-shadow: 0 0 0 4px var(--emerald-faint); }
.field.invalid input { border-color: #ef4444; }
.field.invalid input:focus { box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.field-error {
  display: none; align-items: center; gap: 6px; margin-top: 6px; padding-left: 4px;
  font-size: 12.5px; color: #ef4444; font-weight: 500;
}
.field.invalid .field-error { display: flex; }
.field-error i { font-size: 14px; }
.field-check {
  position: absolute; right: 46px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; background: var(--emerald-faint);
  display: none; place-items: center; color: var(--emerald); font-size: 12px; z-index: 2;
}
.field.valid .field-check { display: grid; }
.field.has-toggle .field-check { right: 50px; }

/* Password strength */
.pw-strength { margin-top: 10px; display: none; }
.field:focus-within ~ .pw-strength,
.pw-strength.active { display: block; }
.pw-bar { height: 5px; border-radius: 100px; background: var(--border); overflow: hidden; margin-bottom: 10px; }
.pw-bar-fill { height: 100%; width: 0%; border-radius: 100px; transition: width .3s, background .3s; background: #ef4444; }
.pw-reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pw-req { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); transition: color .2s; }
.pw-req i { font-size: 14px; color: var(--faint); transition: color .2s; }
.pw-req.met { color: var(--emerald); }
.pw-req.met i { color: var(--emerald); }

/* Row: remember + forgot */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox .cb-box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border2);
  display: grid; place-items: center; transition: all .2s; flex-shrink: 0;
}
.checkbox .cb-box i { font-size: 13px; color: #fff; opacity: 0; transform: scale(.5); transition: all .15s; }
.checkbox input:checked ~ .cb-box { background: linear-gradient(135deg, var(--violet-mid), var(--violet-light)); border-color: transparent; }
.checkbox input:checked ~ .cb-box i { opacity: 1; transform: scale(1); }
.checkbox input:focus-visible ~ .cb-box { box-shadow: 0 0 0 4px var(--violet-faint); }
.auth-row a { font-size: 13.5px; color: var(--violet-mid); font-weight: 600; text-decoration: none; }
.auth-row a:hover { text-decoration: underline; }

/* Terms (register) */
.terms { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.terms a { color: var(--violet-mid); font-weight: 600; }
.terms.invalid .cb-box { border-color: #ef4444; }

/* Submit button */
.auth-submit {
  margin-top: 8px; padding: 15px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--violet-mid), var(--violet-light));
  color: #fff; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow-violet); transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px; position: relative;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 18px 50px rgba(124,58,237,.5); }
.auth-submit:active { transform: translateY(0); }
.auth-submit.loading { pointer-events: none; opacity: .85; }
.auth-submit.loading .as-label { opacity: 0; }
.auth-submit .as-spin {
  position: absolute; width: 22px; height: 22px; border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; display: none; animation: spin .7s linear infinite;
}
.auth-submit.loading .as-spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-switch { text-align: center; margin-top: 24px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--violet-mid); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* Success overlay */
.auth-success { display: none; text-align: center; padding: 20px 0; }
.auth-success.show { display: block; animation: fadeUp .5s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.auth-success-ic {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--emerald-light), var(--emerald));
  display: grid; place-items: center; box-shadow: 0 16px 40px rgba(5,150,105,.4);
  animation: pop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.auth-success-ic i { color: #fff; font-size: 38px; }
.auth-success h2 { font-size: 24px; margin-bottom: 8px; }
.auth-success p { color: var(--muted); font-size: 15px; margin-bottom: 22px; }

/* Entrance animation */
.auth-brand, .auth-main { animation: authIn .7s cubic-bezier(.22,1,.36,1) backwards; }
.auth-main { animation-delay: .12s; }
@keyframes authIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: inline-flex; }
  .auth-main { min-height: 100vh; }
}
@media (max-width: 560px) {
  .auth-main { padding: 28px 18px; }
  .auth-top-bar { top: 18px; right: 18px; }
  .auth-social { grid-template-columns: 1fr; }
  .auth-social-btn { justify-content: flex-start; padding: 13px 16px; }
  .pw-reqs { grid-template-columns: 1fr; }
}
