/* ==========================================================================
   Auth pages (login) — Frooco shop showcase + sign-in card
   ========================================================================== */
.auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Showcase (left) ---------- */
.auth-showcase {
    --orbit: clamp(230px, 38vh, 340px);
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 34px 48px 0;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background: linear-gradient(150deg, #022a1d 0%, #023e2b 38%, #035a40 72%, #0d6a2e 100%);
}
[data-theme="dark"] .auth-showcase {
    background: linear-gradient(150deg, #01150e 0%, #02271b 45%, #033d2b 80%, #0a4f24 100%);
}

.auth-showcase__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    animation: blob-drift 16s ease-in-out infinite alternate;
}
.auth-blob--one { width: 360px; height: 360px; top: -110px; right: -80px; background: #6cb40c; }
.auth-blob--two { width: 320px; height: 320px; bottom: 60px; left: -120px; background: #10b981; opacity: .35; animation-duration: 19s; animation-direction: alternate-reverse; }
.auth-blob--three { width: 220px; height: 220px; top: 38%; left: 46%; background: #a8da1a; opacity: .18; animation-duration: 22s; }

.auth-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .1) 1.2px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 72%);
    mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 72%);
}

.auth-showcase__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: auth-fade-down .7s var(--ease) both;
}
.auth-showcase__logo { height: 44px; }

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
}
.auth-chip__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a8da1a;
    box-shadow: 0 0 0 0 rgba(168, 218, 26, .7);
    animation: live-dot 1.8s ease-out infinite;
}

/* Scene: orbiting groceries around the Frooco cart */
.auth-scene {
    position: relative;
    display: grid;
    place-items: center;
    min-height: calc(var(--orbit) + 40px);
}

.auth-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--orbit);
    height: var(--orbit);
    margin: calc(var(--orbit) / -2) 0 0 calc(var(--orbit) / -2);
    border: 1.5px dashed rgba(255, 255, 255, .16);
    border-radius: 50%;
    animation: spin 40s linear infinite;
}
.auth-orbit--inner {
    --size: calc(var(--orbit) * .58);
    width: var(--size);
    height: var(--size);
    margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
    border-color: rgba(168, 218, 26, .22);
    animation-duration: 28s;
    animation-direction: reverse;
}

.auth-orbit__item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: rotate(var(--angle)) translateY(calc(var(--orbit) / -2));
}
.auth-orbit--inner .auth-orbit__item { transform: rotate(var(--angle)) translateY(calc(var(--orbit) * -.29)); }

.auth-orbit__bubble {
    position: absolute;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 12px 26px -8px rgba(0, 0, 0, .45), inset 0 -3px 0 rgba(2, 62, 43, .08);
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle)));
    animation: bubble-breathe 4s ease-in-out infinite;
}
.auth-orbit__bubble--sm { width: 46px; height: 46px; }
.auth-orbit__item:nth-child(2n) .auth-orbit__bubble { animation-delay: -1.3s; }
.auth-orbit__item:nth-child(3n) .auth-orbit__bubble { animation-delay: -2.6s; }

/* Counter-rotate so the groceries stay upright while the orbit spins */
.auth-orbit--outer .grocery { animation: spin 40s linear infinite reverse; }
.auth-orbit--inner .grocery { animation: spin 28s linear infinite; }

.auth-core {
    position: relative;
    display: grid;
    place-items: center;
    width: calc(var(--orbit) * .36);
    height: calc(var(--orbit) * .36);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(168, 218, 26, .32), rgba(255, 255, 255, .06) 70%);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 60px rgba(108, 180, 12, .35);
}
.auth-core__logo { width: 68%; height: 68%; justify-content: center; animation: core-float 4s ease-in-out infinite; }
.auth-core__pulse {
    position: absolute;
    inset: -2px;
    border: 2px solid rgba(168, 218, 26, .55);
    border-radius: 50%;
    animation: core-pulse 3.2s ease-out infinite;
}
.auth-core__pulse--late { animation-delay: 1.6s; }

/* Floating notification cards */
.auth-float {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 10px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 16px;
    background: rgba(255, 255, 255, .95);
    color: #0c2419;
    box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .5);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    animation: card-in .7s cubic-bezier(.26, 1.3, .5, 1) both, card-float 6s ease-in-out infinite;
}
.auth-float--order { top: 4%; right: 2%; animation-delay: .5s, 1.2s; }
.auth-float--delivered { bottom: 6%; left: 0; animation-delay: .8s, 0s; }
.auth-float--rating { top: 16%; left: 2%; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px; animation-delay: 1.1s, 2.4s; }

.auth-float__icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
}
.auth-float__icon--green { background: rgba(2, 120, 88, .12); color: #027858; }
.auth-float__icon--lime { background: rgba(108, 180, 12, .16); color: #4d8f08; }
.auth-float__title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.auth-float__meta { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 11.5px; color: #5d7468; }
.auth-float__live {
    padding: 1px 7px;
    border-radius: 999px;
    background: #6cb40c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.auth-float__stars { display: flex; gap: 2px; color: #f59e0b; }
.auth-float__stars svg { fill: currentColor; }

/* Hero copy */
.auth-hero { padding-bottom: 6px; animation: auth-rise .8s var(--ease) .2s both; }
.auth-hero__title {
    font-size: clamp(30px, 3.1vw, 44px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
}
.auth-hero__text { max-width: 480px; margin-top: 14px; font-size: 15.5px; line-height: 1.65; color: rgba(255, 255, 255, .78); }

.word-rotator {
    display: inline-block;
    height: 1.3em;
    margin: -.1em 0;
    overflow: hidden;
    vertical-align: bottom;
}
.word-rotator__track { display: flex; flex-direction: column; animation: word-rotate 7.5s cubic-bezier(.7, 0, .3, 1) infinite; }
.word-rotator__track span {
    display: block;
    height: 1.3em;
    line-height: 1.3;
    background: linear-gradient(90deg, #a8da1a, #6ee7a0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-stats { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 22px; }
.auth-stats li { display: flex; flex-direction: column; padding-left: 14px; border-left: 2px solid rgba(168, 218, 26, .6); }
.auth-stats strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.auth-stats span { font-size: 12.5px; color: rgba(255, 255, 255, .7); }

/* Delivery road */
.auth-road {
    position: relative;
    height: 84px;
    margin: 10px -48px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .22));
    overflow: hidden;
}
.auth-road__lane {
    position: absolute;
    left: 0;
    right: 0;
    top: 62%;
    height: 3px;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .32) 0 26px, transparent 26px 52px);
    animation: road-lane .7s linear infinite;
}
.auth-road__cart {
    position: absolute;
    bottom: calc(38% - 9px);
    left: -12%;
    display: flex;
    align-items: center;
    animation: cart-drive 11s linear infinite;
}
.auth-road__logo { width: 56px; height: 56px; animation: cart-bounce .38s ease-in-out infinite alternate; }
.auth-road__speed { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; margin-right: 4px; }
.auth-road__speed i {
    display: block;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, #a8da1a);
    animation: speed-line .45s ease-in-out infinite alternate;
}
.auth-road__speed i:nth-child(1) { width: 26px; }
.auth-road__speed i:nth-child(2) { width: 40px; animation-delay: .15s; }
.auth-road__speed i:nth-child(3) { width: 20px; animation-delay: .3s; }

/* ---------- Sign-in panel (right) ---------- */
.auth-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 84px 24px 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 8%, rgba(108, 180, 12, .14), transparent 38%),
        radial-gradient(circle at 8% 96%, rgba(2, 120, 88, .14), transparent 42%),
        var(--color-bg);
}

.auth-panel__top { position: absolute; top: 20px; right: 24px; display: flex; align-items: center; gap: 12px; }
.auth-panel__top .icon-btn { border-color: var(--color-border); background: var(--color-surface); box-shadow: var(--shadow-sm); }

.auth-card {
    position: relative;
    width: 100%;
    max-width: 432px;
    padding: 34px 34px 26px;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}
.auth-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 28px;
    right: 28px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #027858, #6cb40c, #a8da1a);
}

.auth-card__logo { display: flex; justify-content: center; height: 100px; margin-bottom: 20px; }

.auth-card__header { margin-bottom: 26px; text-align: center; }
.auth-card__header h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-card__header p { margin-top: 6px; color: var(--color-muted); }

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .form-control { height: 50px; border-radius: 12px; background: var(--color-surface-2); }
.auth-form .form-control:focus { background: var(--color-surface); }
.auth-form .input-icon:focus-within .input-icon__icon { color: var(--color-primary); }
.auth-form .btn { height: 52px; border-radius: 13px; margin-top: 4px; }

.btn--shine { overflow: hidden; }
.btn--shine::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
    transform: translateX(-110%);
    pointer-events: none;
}
.btn--shine:hover::after { transform: translateX(110%); transition: transform 750ms var(--ease); }
.btn__arrow { transition: transform var(--transition); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn.is-loading .btn__arrow { display: none; }

.auth-card__secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
    font-size: 12.5px;
    color: var(--color-muted);
}
.auth-card__secure svg { color: var(--color-primary); }

.auth-panel__footer { margin-top: 26px; font-size: 12.5px; color: var(--color-muted); }

.auth-animate { animation: auth-rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }

/* ---------- Keyframes ---------- */
@keyframes auth-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes auth-fade-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes blob-drift { from { translate: 0 0; } to { translate: 60px 40px; } }
@keyframes live-dot { 0% { box-shadow: 0 0 0 0 rgba(168, 218, 26, .7); } 100% { box-shadow: 0 0 0 10px rgba(168, 218, 26, 0); } }
@keyframes bubble-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
@keyframes core-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes core-pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes card-in { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }
@keyframes card-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes word-rotate {
    0%, 22% { transform: translateY(0); }
    30%, 52% { transform: translateY(-1.3em); }
    60%, 82% { transform: translateY(-2.6em); }
    90%, 100% { transform: translateY(-3.9em); }
}
@keyframes road-lane { from { background-position: 0 0; } to { background-position: -52px 0; } }
@keyframes cart-drive { from { left: -12%; } to { left: 108%; } }
@keyframes cart-bounce { from { translate: 0 0; } to { translate: 0 -3px; } }
@keyframes speed-line { from { opacity: .35; scale: .55 1; } to { opacity: 1; scale: 1 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
    .auth-showcase { padding: 30px 36px 0; }
    .auth-road { margin: 10px -36px 0; }
    .auth-float--rating { display: none; }
}

@media (max-height: 820px) {
    .auth-showcase { --orbit: clamp(200px, 32vh, 280px); }
    .auth-float--rating { display: none; }
    .auth-hero__text { display: none; }
}

@media (max-height: 680px) {
    .auth-scene { display: none; }
    .auth-showcase { grid-template-rows: auto 1fr auto auto; }
    .auth-hero { align-self: center; }
}

@media (max-width: 991px) {
    .auth-page { grid-template-columns: minmax(0, 1fr); }
    .auth-showcase { display: none; }
}

@media (max-width: 479px) {
    .auth-panel { padding: 76px 16px 24px; }
    .auth-card { padding: 28px 20px 22px; border-radius: 20px; }
    .auth-card__logo { height: 84px; }
}
