<script setup lang="ts">
/**
 * PC auth shell — admin-style card: large logo left, form slot right.
 */
import MouseRippleGrid from '../MouseRippleGrid.vue';
import LocaleSwitcher from '../LocaleSwitcher.vue';

withDefaults(
  defineProps<{
    /** Wider card for register / forgot-password forms */
    wide?: boolean;
  }>(),
  { wide: false },
);
</script>

<template>
  <div class="desktop-auth-page">
    <div class="ambient-glow ambient-glow--1" aria-hidden="true"></div>
    <div class="ambient-glow ambient-glow--2" aria-hidden="true"></div>
    <MouseRippleGrid />

    <div class="auth-wrap">
      <div class="auth-card" :class="{ 'auth-card--wide': wide }">
        <div class="form-lang">
          <LocaleSwitcher compact />
        </div>
        <div class="form-body">
          <aside class="form-brand">
            <img src="/logo.png" alt="TheBet365" class="logo-large" />
          </aside>
          <div class="form-fields">
            <slot />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.desktop-auth-page {
  position: relative;
  min-height: 100dvh;
  background: linear-gradient(135deg, #0a0a0a 0%, #111 50%, #0d0d0d 100%);
  overflow: hidden;
  font-family: var(--font-body);
}

.desktop-auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 40%, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.12;
  z-index: 0;
}

.ambient-glow--1 {
  width: 320px;
  height: 320px;
  top: 10%;
  left: 12%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.5) 0%, transparent 70%);
  animation: ambient-drift-1 12s ease-in-out infinite alternate;
}

.ambient-glow--2 {
  width: 280px;
  height: 280px;
  bottom: 12%;
  right: 12%;
  background: radial-gradient(circle, rgba(240, 216, 117, 0.35) 0%, transparent 70%);
  animation: ambient-drift-2 16s ease-in-out infinite alternate;
}

@keyframes ambient-drift-1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(30px, -20px) scale(1.1);
  }
}

@keyframes ambient-drift-2 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-25px, 15px) scale(0.95);
  }
}

.auth-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 20px;
  overflow-y: auto;
}

.auth-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 720px;
  background:
    linear-gradient(rgba(8, 8, 7, 0.18), rgba(8, 8, 7, 0.24)),
    url('../../assets/images/generated/auth-panel-bg-v1.webp') center / 100% 100% no-repeat;
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 0;
  border-radius: 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition:
    filter 0.22s ease,
    transform 0.22s ease;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: url('../../assets/images/generated/auth-panel-bg-v1.webp') center / 100% 100% no-repeat;
  filter: brightness(1.28) saturate(1.16);
  mix-blend-mode: screen;
  transition: opacity 0.22s ease;
}

.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 8%, rgba(255, 226, 156, 0.08) 50%, transparent 92%),
    radial-gradient(circle at 72% 48%, rgba(212, 175, 55, 0.1), transparent 34%);
  transition: opacity 0.22s ease;
}

.auth-card:focus-within {
  transform: translateY(-2px);
  filter: brightness(1.04) saturate(1.05);
}

.auth-card:focus-within::before {
  opacity: 0.2;
}

.auth-card:focus-within::after {
  opacity: 1;
}

.auth-card--wide {
  max-width: 820px;
}

.form-lang {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 14px 24px 0;
}

.form-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 24px;
  align-items: stretch;
}

.form-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-5);
  background: rgba(0, 0, 0, 0.18);
  border-right: 1px solid rgba(212, 175, 55, 0.15);
}

.logo-large {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(212, 175, 55, 0.25));
}

.form-fields {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 24px 24px 0;
}

@media (max-width: 640px) {
  .auth-wrap {
    align-items: flex-start;
    padding: 18px;
  }

  .auth-card,
  .auth-card--wide {
    max-width: 420px;
  }

  .form-body {
    grid-template-columns: 1fr;
  }

  .form-brand {
    padding: 20px 24px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  }

  .logo-large {
    max-width: 180px;
  }

  .form-fields {
    padding: 18px 24px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-glow--1,
  .ambient-glow--2 {
    animation: none;
  }
}
</style>
