/* =========================================================
   JVS Marketing — Login / Register / Forgot Password
   Loaded after home-1.css (re-uses its tokens and buttons)
   ========================================================= */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --danger: #d93a3a;
  --ok: #1e9e5a;
}

body.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.1fr); background: var(--soft); }

/* ===== Left showcase panel ===== */
.auth__aside {
  position: sticky; top: 0; height: 100vh; overflow: hidden; color: var(--white);
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px;
  background: radial-gradient(circle at 20% 10%, var(--navy-700), var(--navy-900) 65%);
}
.auth__aside::after { content: ""; position: absolute; inset: 0; background: url('https://images.pexels.com/photos/7581120/pexels-photo-7581120.jpeg?auto=compress&cs=tinysrgb&w=1400') center/cover; opacity: .09; pointer-events: none; }
.auth__aside > * { position: relative; z-index: 1; }
.auth__net { position: absolute !important; inset: 0; width: 100%; height: 100%; z-index: 0 !important; pointer-events: none; }
.auth__aside .brand__text, .auth__aside .brand__text strong { color: var(--white); }
.auth__aside .brand__text small { color: #9aa8c5; }

.auth__pitch h1 { color: var(--white); font-size: clamp(30px, 3vw, 42px); font-weight: 800; letter-spacing: -.02em; margin: 14px 0 16px; }
.auth__pitch h1 em { font-family: "Playfair Display", serif; color: var(--gold-2); }
.auth__pitch > p { color: #c9d3e8; max-width: 440px; }
.auth__perks { display: grid; gap: 14px; margin-top: 30px; }
.auth__perks li { display: flex; align-items: center; gap: 14px; color: #dbe3f3; font-weight: 600; opacity: 0; transform: translateX(-24px); animation: slide-in .7s var(--ease-out) forwards; animation-delay: calc(.5s + var(--i, 0) * .12s); }
.auth__perks span { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(244, 180, 0, .14); color: var(--gold-2); border: 1px solid rgba(244, 180, 0, .3); }
@keyframes slide-in { to { opacity: 1; transform: none; } }

.auth__mini-tree { width: 100%; max-width: 360px; margin-top: 30px; }
.auth__mini-tree path { fill: none; stroke: rgba(244, 180, 0, .6); stroke-width: 2.5; stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 1.2s var(--ease-out) .6s forwards; }
.auth__mini-tree circle { fill: var(--navy-700); stroke: var(--gold); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; transform: scale(0); animation: pop .5s var(--ease-spring) forwards; animation-delay: calc(.3s + var(--i, 0) * .12s); }
.auth__mini-tree .root { fill: var(--gold); stroke: var(--white); }
.auth__mini-tree .hl { fill: var(--teal); stroke: var(--white); animation: pop .5s var(--ease-spring) forwards, beacon 2s ease-in-out 1.6s infinite; animation-delay: calc(.3s + var(--i, 0) * .12s), 1.6s; }
.auth__mini-tree text { fill: #9aa8c5; font: 600 10px var(--ff-head); letter-spacing: .2em; text-anchor: middle; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { transform: scale(1); } }
@keyframes beacon { 50% { filter: drop-shadow(0 0 8px rgba(18, 181, 176, .9)); } }

.auth__foot { font-size: 12.5px; color: #8191b3; }

/* ===== Right form area ===== */
.auth__main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; overflow: hidden; }
.auth__main::before, .auth__main::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35; pointer-events: none; animation: drift 14s ease-in-out infinite alternate; }
.auth__main::before { width: 380px; height: 380px; background: var(--gold-2); top: -120px; right: -100px; }
.auth__main::after { width: 320px; height: 320px; background: var(--teal); bottom: -120px; left: -80px; opacity: .22; animation-duration: 18s; }
@keyframes drift { to { transform: translate(-40px, 40px) scale(1.15); } }

.auth__top { position: relative; z-index: 1; width: 100%; max-width: 520px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-size: 14px; color: var(--muted); }
.auth__top a { font-weight: 700; color: var(--navy-800); transition: color .2s; }
.auth__top a:hover { color: var(--gold-dk); }
.auth__back { display: inline-flex; align-items: center; gap: 6px; }
.auth__back:hover { gap: 10px; }
.auth__brand-sm { display: none; }

.card {
  position: relative; z-index: 1; width: 100%; max-width: 520px; background: var(--white);
  border-radius: 26px; padding: 44px 42px; box-shadow: 0 40px 90px -40px rgba(6, 20, 46, .45);
  animation: card-in .9s var(--ease-out) both;
}
.card::before { content: ""; position: absolute; top: 0; left: 42px; right: 42px; height: 4px; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, var(--teal), var(--gold-2), var(--gold)); background-size: 200% 100%; animation: bar 4s linear infinite; }
@keyframes card-in { from { opacity: 0; transform: translateY(40px) scale(.98); } }
@keyframes bar { to { background-position: -200% 0; } }

.card__head { margin-bottom: 28px; }
.card__head h2 { font-size: 28px; margin-bottom: 6px; }
.card__head p { color: var(--muted); font-size: 15px; }
.card__icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; margin-bottom: 18px; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: var(--gold-2); box-shadow: 0 12px 24px -10px rgba(6, 20, 46, .6); animation: wobble 4s ease-in-out 1s infinite; }
@keyframes wobble { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-10deg); } 96% { transform: rotate(8deg); } }

/* staggered field entrance */
.stagger > * { opacity: 0; transform: translateY(18px); animation: rise .6s var(--ease-out) forwards; }
.stagger > *:nth-child(1) { animation-delay: .15s; }
.stagger > *:nth-child(2) { animation-delay: .22s; }
.stagger > *:nth-child(3) { animation-delay: .29s; }
.stagger > *:nth-child(4) { animation-delay: .36s; }
.stagger > *:nth-child(5) { animation-delay: .43s; }
.stagger > *:nth-child(6) { animation-delay: .5s; }
.stagger > *:nth-child(n+7) { animation-delay: .57s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ===== Floating-label fields ===== */
.form { display: grid; gap: 18px; }
.field { position: relative; }
.field input, .field select {
  height: 58px; padding: 22px 48px 8px 50px; background: var(--soft); border: 1.5px solid var(--line); border-radius: 14px;
  font: 600 15px var(--ff-body); color: var(--ink); transition: border-color .2s, background .2s, box-shadow .2s;
}
.field select { appearance: none; cursor: pointer; }
.field label {
  position: absolute; left: 50px; top: 29px; transform: translateY(-50%); transform-origin: left;
  font: 500 15px var(--ff-body); color: var(--muted); pointer-events: none; transition: .22s var(--ease-out);
}
.field input:focus ~ label, .field input:not(:placeholder-shown) ~ label,
.field select:focus ~ label, .field select:valid ~ label {
  top: 17px; transform: translateY(-50%) scale(.78); color: var(--gold-dk); font-weight: 700;
}
.field input::placeholder { color: transparent; }
.field__ic { position: absolute; left: 16px; top: 29px; transform: translateY(-50%); width: 22px; text-align: center; font-size: 17px; color: var(--muted); transition: color .2s, transform .3s var(--ease-spring); }
.field:focus-within .field__ic { color: var(--gold-dk); transform: translateY(-50%) scale(1.15); }
.field__eye { position: absolute; right: 8px; top: 29px; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 17px; color: var(--muted); }
.field__eye:hover { background: var(--line); }
.field__eye.is-on { color: var(--gold-dk); }
.field__addon { position: absolute; right: 8px; top: 29px; transform: translateY(-50%); height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--navy-800); color: var(--white); font: 600 13px var(--ff-head); cursor: pointer; transition: background .2s; }
.field__addon:hover { background: var(--navy-700); }
.field--addon input { padding-right: 110px; }
.field__hint { display: block; font-size: 12.5px; color: var(--muted); margin: 6px 4px 0; min-height: 1em; }
.field__hint.is-ok { color: var(--ok); }
.field__hint.is-err { color: var(--danger); }

.field.is-invalid input, .field.is-invalid select { border-color: var(--danger); background: #fff6f6; animation: shake .4s; }
.field.is-invalid .field__ic { color: var(--danger); }
.field.is-valid input { border-color: var(--ok); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form__opts { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.form__opts a, .link { color: var(--gold-dk); font-weight: 700; }
.form__opts a:hover, .link:hover { text-decoration: underline; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--muted); line-height: 1.5; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check i { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); background: var(--white); display: grid; place-items: center; transition: .2s; margin-top: 1px; }
.check i::after { content: ""; width: 5px; height: 10px; border: solid var(--white); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .25s var(--ease-spring); }
.check input:checked + i { background: var(--gold-dk); border-color: var(--gold-dk); }
.check input:checked + i::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + i { box-shadow: 0 0 0 4px rgba(244, 180, 0, .25); }
.check.is-invalid i { border-color: var(--danger); animation: shake .4s; }

/* submit button loading */
.btn--submit { height: 56px; font-size: 16px; }
.btn--submit .spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: currentColor; animation: spin .8s linear infinite; }
.btn--submit.is-loading { pointer-events: none; opacity: .9; }
.btn--submit.is-loading .spinner { display: inline-block; }
.btn--submit.is-loading .btn__label { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn--gold::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease-out); }
.btn--gold:hover::before { transform: translateX(120%); }
.btn { position: relative; overflow: hidden; }
.btn--light { background: var(--soft); color: var(--navy-800); border-color: var(--line); }
.btn--light:hover { background: var(--line); }

.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.card__alt { text-align: center; font-size: 14.5px; color: var(--muted); margin-top: 24px; }

.alert { display: none; padding: 13px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.alert.is-shown { display: block; animation: rise .4s var(--ease-out) both; }
.alert--err { background: #fff0f0; color: var(--danger); border: 1px solid #f6caca; }
.alert--info { background: #eefbfa; color: #0c7d79; border: 1px solid #bfe9e7; }

/* ===== Stepper (register / forgot) ===== */
.stepper { display: flex; justify-content: space-between; position: relative; margin-bottom: 30px; }
.stepper::before, .stepper__fill { content: ""; position: absolute; top: 18px; left: 18px; right: 18px; height: 3px; border-radius: 3px; background: var(--line); }
.stepper__fill { right: auto; width: calc((100% - 36px) * var(--p, 0)); background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .6s var(--ease-out); }
.stepper__item { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 600 12px var(--ff-head); color: var(--muted); text-align: center; width: 90px; }
.stepper__item:first-of-type { align-items: flex-start; text-align: left; }
.stepper__item:last-of-type { align-items: flex-end; text-align: right; }
.stepper b { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--white); border: 2px solid var(--line); font-size: 14px; color: var(--muted); transition: .4s var(--ease-spring); }
.stepper__item.is-active { color: var(--navy-800); }
.stepper__item.is-active b { border-color: var(--gold); color: var(--navy-900); background: var(--gold-2); transform: scale(1.12); box-shadow: 0 0 0 6px rgba(244, 180, 0, .18); }
.stepper__item.is-done b { border-color: var(--teal); background: var(--teal); color: var(--white); }
.stepper__item.is-done b span { display: none; }
.stepper__item.is-done b::after { content: "\2713"; }

[hidden] { display: none !important; }
.step { display: none; border: 0; padding: 0; margin: 0; min-width: 0; }
.step.is-active { display: grid; gap: 18px; animation: step-in .5s var(--ease-out) both; }
.step.is-back { animation-name: step-back; }
@keyframes step-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes step-back { from { opacity: 0; transform: translateX(-40px); } }
.step__nav { display: flex; gap: 12px; }
.step__nav .btn { flex: 1; }
.step__title { font: 700 13px var(--ff-head); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }

/* ===== Position picker (Left / Right leg) ===== */
.legs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.leg { position: relative; cursor: pointer; }
.leg input { position: absolute; opacity: 0; }
.leg__box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--soft); transition: .3s var(--ease-out); text-align: center; }
.leg__box svg { width: 92px; height: 56px; }
.leg__box svg path { fill: none; stroke: #c3cbdb; stroke-width: 2.5; stroke-linecap: round; transition: stroke .3s; }
.leg__box svg circle { fill: var(--white); stroke: #c3cbdb; stroke-width: 2.5; transition: .3s; }
.leg__box svg .me { fill: #c3cbdb; }
.leg__box strong { font: 700 16px var(--ff-head); color: var(--navy-800); }
.leg__box small { font-size: 12px; color: var(--muted); }
.leg:hover .leg__box { border-color: var(--gold-2); transform: translateY(-3px); }
.leg input:checked + .leg__box { border-color: var(--gold); background: #fffaeb; box-shadow: 0 14px 30px -16px rgba(201, 138, 0, .7); }
.leg input:checked + .leg__box svg path.on { stroke: var(--gold); }
.leg input:checked + .leg__box svg .me { fill: var(--gold); stroke: var(--gold-dk); animation: beacon-gold 1.6s ease-in-out infinite; }
.leg input:checked + .leg__box svg .top { stroke: var(--navy-800); fill: var(--navy-800); }
.leg input:focus-visible + .leg__box { box-shadow: 0 0 0 4px rgba(244, 180, 0, .3); }
.legs.is-invalid .leg__box { border-color: var(--danger); animation: shake .4s; }
@keyframes beacon-gold { 50% { filter: drop-shadow(0 0 6px rgba(244, 180, 0, .9)); } }

.sponsor-chip { display: none; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #eefbfa; border: 1px dashed var(--teal); font-size: 14px; color: #0c7d79; }
.sponsor-chip.is-shown { display: flex; animation: rise .4s var(--ease-out) both; }
.sponsor-chip b { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--white); }

/* ===== Password strength ===== */
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 4px 0; }
.strength i { height: 5px; border-radius: 5px; background: var(--line); transition: background .3s; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: #f08c1a; }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--gold); }
.strength[data-score="4"] i { background: var(--ok); }

/* ===== OTP ===== */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.otp input { height: 60px; padding: 0; text-align: center; font: 700 24px var(--ff-head); border-radius: 14px; caret-color: var(--gold-dk); transition: .2s, transform .25s var(--ease-spring); }
.otp input:focus { transform: translateY(-3px); }
.otp input.is-filled { border-color: var(--gold); background: #fffaeb; }
.otp.is-invalid input { border-color: var(--danger); animation: shake .4s; }
.otp__meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.otp__resend { border: 0; background: none; font: 700 14px var(--ff-body); color: var(--gold-dk); cursor: pointer; }
.otp__resend:disabled { color: var(--muted); cursor: not-allowed; }

/* ===== Success ===== */
.success { text-align: center; display: grid; justify-items: center; gap: 14px; }
.success__check { width: 96px; height: 96px; }
.success__check circle { fill: none; stroke: var(--ok); stroke-width: 4; stroke-dasharray: 290; stroke-dashoffset: 290; animation: draw .7s var(--ease-out) forwards; }
.success__check path { fill: none; stroke: var(--ok); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s var(--ease-out) .6s forwards; }
.success h3 { font-size: 24px; }
.success p { color: var(--muted); max-width: 360px; }
.success .btn { margin-top: 8px; }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 200; pointer-events: none; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 720deg)); } }

.demo-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  body.auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__brand-sm { display: inline-flex; }
  .auth__brand-sm img { width: 44px; height: 44px; }
  .auth__main { justify-content: flex-start; padding-top: 28px; min-height: 100vh; }
}
@media (max-width: 560px) {
  .card { padding: 34px 20px 28px; border-radius: 22px; }
  .card::before { left: 20px; right: 20px; }
  .card__head h2 { font-size: 24px; }
  .row-2 { grid-template-columns: 1fr; }
  .otp { gap: 6px; }
  .otp input { height: 52px; font-size: 20px; }
  .stepper__item { width: 70px; font-size: 11px; }
  .form__opts { flex-wrap: wrap; }
  .auth__top .auth__back span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
