/*
 * D-086: login + OTP pop-ups (#login-modal, #login-otp-modal in layouts/partials/footer.blade.php).
 * Split card from the My Account prototype: dark brand stage with floating policy cards on the left, the form on the
 * right; a bottom sheet on phones. Buttons are .cy-btn (design system). Motion is off under reduced motion.
 */
.cy-auth-modal .cy-auth-dialog { max-width: 880px; width: calc(100% - 32px); margin-inline: auto; }
.cy-auth-modal .modal-content.cy-auth { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 520px; border: 0; border-radius: 28px; overflow: hidden; background: #fff; box-shadow: 0 40px 80px -30px rgba(21, 17, 15, .55); font-family: var(--cy-font); }
.cy-auth-modal.fade .cy-auth-dialog { transform: translateY(16px) scale(.97); transition: transform .45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cy-auth-modal.show .cy-auth-dialog { transform: none; }

/* brand stage */
.cy-auth__stage { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 30px 28px 24px; color: #f6ece8;
  background: radial-gradient(90% 70% at 85% 95%, rgba(255,106,85,.55), transparent 60%), radial-gradient(70% 60% at 0% 0%, rgba(184,50,31,.6), transparent 60%), #160b08; }
.cy-auth__orbit { position: absolute; left: 50%; top: 54%; width: 400px; height: 400px; margin: -200px 0 0 -200px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.12); animation: cy-auth-spin 60s linear infinite; }
.cy-auth__orbit::before { content: ""; position: absolute; inset: 70px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); }
.cy-auth__orbit::after { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #ff8a6b; box-shadow: 0 0 18px #ff8a6b; }
.cy-auth__tag { position: relative; font-family: var(--cy-font-special); font-size: 17px; line-height: 24px; color: #ff9478; }
.cy-auth__h { position: relative; margin: 6px 0 0; color: #fff; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.03em; }
.cy-auth__cards { position: relative; flex: 1; min-height: 200px; }
.cy-auth__mini { position: absolute; width: 184px; aspect-ratio: 1.58; border-radius: 15px; padding: 11px 13px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; font-size: 10.5px; line-height: 13px; font-weight: 600;
  box-shadow: 0 24px 40px -18px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.3); animation: cy-auth-float 6s ease-in-out infinite; }
.cy-auth__mini b { font-size: 16px; line-height: 20px; font-weight: 750; letter-spacing: -.02em; }
.cy-auth__mini--a { left: 0; top: 34px; --rot: -9deg; background: radial-gradient(130% 120% at 0% 0%, #2fd4a0, #0c8f6c 50%, #063d31); }
.cy-auth__mini--b { left: 112px; top: 2px; --rot: 7deg; background: radial-gradient(130% 120% at 0% 0%, #8c96ff, #4450e6 50%, #1c1f6b); animation-delay: -2s; }
.cy-auth__mini--c { left: 50px; top: 92px; --rot: -2deg; z-index: 2; background: radial-gradient(130% 120% at 0% 0%, #ff7a5c, #c23a24 50%, #5c170e); animation-delay: -4s; }
.cy-auth__ticker { position: relative; display: block; height: 36px; overflow: hidden; margin-top: 10px; }
.cy-auth__ticker-in { display: block; animation: cy-auth-ticker 9s cubic-bezier(0.2, 0.8, 0.2, 1) infinite; }
.cy-auth__ticker-in span { display: flex; align-items: center; height: 36px; font-size: 13.5px; color: #e6d7d0; }
.cy-auth__ticker-in span::before { content: ""; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: #ff8a6b; flex: none; }
.cy-auth__legal { position: relative; margin-top: 12px; font-size: 10.5px; line-height: 14px; color: #a6928a; }

/* form side */
.cy-auth__form { position: relative; display: flex; flex-direction: column; padding: 38px 42px 26px; color: var(--cy-text-body); }
.cy-auth__x.close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%; background: var(--cy-neutral-100); opacity: 1; display: grid; place-items: center; color: var(--cy-text-primary); text-shadow: none; padding: 0; transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color .2s; }
.cy-auth__x.close:hover { transform: rotate(90deg); background: var(--cy-neutral-200); opacity: 1; }
.cy-auth__x .cy-icon { width: 18px; height: 18px; }
.cy-auth__steps { display: flex; gap: 6px; margin: 0 52px 22px 0; }
.cy-auth__steps i { position: relative; flex: 1; height: 4px; border-radius: 4px; background: var(--cy-neutral-100); overflow: hidden; }
.cy-auth__steps i.on::after { content: ""; position: absolute; inset: 0; background: var(--cy-primary); animation: cy-auth-fill .6s cubic-bezier(0.2, 0.8, 0.2, 1) both .2s; }
.cy-auth__head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.cy-auth__eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--cy-brand-700); }
.cy-auth__title { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.03em; color: var(--cy-text-primary); }
.cy-auth__sub { margin: 0; color: var(--cy-text-secondary); font-size: 14px; line-height: 20px; }
.cy-auth__num { color: var(--cy-text-primary); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cy-auth__why { margin: 6px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--cy-info-50); color: var(--cy-info-600); font-size: 13px; font-weight: 550; }
.cy-auth__why[hidden] { display: none; }
.cy-auth__back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-bottom: 8px; color: var(--cy-brand-700); font-weight: 600; font-size: 13px; text-decoration: none; }
.cy-auth__back:hover { text-decoration: none; color: var(--cy-brand-700); }
.cy-auth__back .cy-icon { transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cy-auth__back:hover .cy-icon { transform: translateX(-3px); }
.cy-auth__body { display: flex; flex-direction: column; gap: 14px; }
.cy-auth__phone { display: flex; align-items: center; height: 58px; border-radius: 16px; background: var(--cy-neutral-50); box-shadow: inset 0 0 0 1px var(--cy-neutral-300); transition: box-shadow .2s, background-color .2s; }
.cy-auth__phone:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--cy-primary), 0 0 0 5px rgba(240, 93, 73, .18); }
.cy-auth__cc { display: flex; align-items: center; height: 32px; padding: 0 14px 0 18px; border-right: 1px solid var(--cy-neutral-300); font-weight: 650; color: var(--cy-text-primary); }
.cy-auth__phone input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 14px; font: inherit; font-size: 19px; font-weight: 600; letter-spacing: .04em; color: var(--cy-text-primary); font-variant-numeric: tabular-nums; }
.cy-auth__phone input::placeholder { font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--cy-neutral-400); }
.cy-auth__ok { width: 26px; height: 26px; margin-right: 14px; border-radius: 50%; background: var(--cy-success-600); color: #fff; display: grid; place-items: center; transform: scale(0); transition: transform .4s cubic-bezier(0.34, 1.56, 0.64, 1); flex: none; }
.cy-auth__ok .cy-icon { width: 16px; height: 16px; }
.cy-auth__phone.is-valid .cy-auth__ok { transform: scale(1); }
.cy-auth__err { color: var(--cy-critical-600); font-size: 13px; font-weight: 550; }
.cy-auth__err:empty { display: none; }
.cy-auth__trust { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--cy-text-secondary); }
.cy-auth__trust .cy-icon { color: var(--cy-success-600); }
.cy-auth__legalline { margin: auto 0 0; padding-top: 18px; font-size: 12px; line-height: 17px; color: var(--cy-text-secondary); }
.cy-auth__legalline a { color: var(--cy-text-body); text-decoration: underline; }
.cy-auth__otp { display: flex; gap: 12px; }
.cy-auth__otp input { width: 64px; height: 70px; border: 0; border-radius: 18px; text-align: center; font: inherit; font-size: 28px; font-weight: 700; color: var(--cy-text-primary); background: var(--cy-neutral-50); box-shadow: inset 0 0 0 1px var(--cy-neutral-300); font-variant-numeric: tabular-nums;
  transition: box-shadow .2s, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color .2s; }
.cy-auth__otp input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1.5px var(--cy-primary), 0 0 0 5px rgba(240, 93, 73, .18); transform: translateY(-2px); }
.cy-auth__otp input.has { animation: cy-auth-pop .3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cy-auth__otp.is-bad { animation: cy-auth-shake .4s; }
.cy-auth__otp.is-bad input { box-shadow: inset 0 0 0 1.5px var(--cy-critical-600); background: var(--cy-critical-50); }
.cy-auth__resend { margin: 0; font-size: 13px; color: var(--cy-text-secondary); }
.cy-auth__resend a { color: var(--cy-brand-700); font-weight: 600; }
.cy-auth__resend a.disabled { color: var(--cy-text-secondary); pointer-events: none; font-weight: 500; font-variant-numeric: tabular-nums; }

@keyframes cy-auth-spin { to { transform: rotate(360deg); } }
@keyframes cy-auth-float { 0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); } 50% { transform: translateY(-10px) rotate(var(--rot, 0deg)); } }
@keyframes cy-auth-ticker { 0%, 28% { transform: translateY(0); } 33%, 61% { transform: translateY(-36px); } 66%, 94% { transform: translateY(-72px); } 100% { transform: translateY(-108px); } }
@keyframes cy-auth-fill { from { transform: translateX(-100%); } }
@keyframes cy-auth-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } }
@keyframes cy-auth-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* tablets: drop the stage; phones: bottom sheet */
@media (max-width: 799px) {
  .cy-auth-modal .modal-content.cy-auth { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .cy-auth__stage { display: none; }
}
@media (max-width: 575px) {
  .cy-auth-modal .cy-auth-dialog { width: 100%; max-width: none; margin: 0; min-height: 100%; display: flex; align-items: flex-end; }
  .cy-auth-modal.fade .cy-auth-dialog { transform: translateY(100%); transition: transform .45s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .cy-auth-modal.show .cy-auth-dialog { transform: none; }
  .cy-auth-modal .modal-content.cy-auth { border-radius: 28px 28px 0 0; width: 100%; }
  .cy-auth__form { padding: 30px 20px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .cy-auth__form::before { content: ""; position: absolute; top: 10px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 5px; background: var(--cy-neutral-200); }
  .cy-auth__title { font-size: 24px; line-height: 30px; }
  /* min-width 0: an input's minimum width follows its font size (28px -> ~390px), which pushed 3 boxes off-screen */
  .cy-auth__otp input { flex: 1 1 0; width: 0; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cy-auth-modal *, .cy-auth-modal *::before, .cy-auth-modal *::after, .cy-auth-modal .cy-auth-dialog { animation: none !important; transition: none !important; }
}
