/**
 * Agon Login — Premium fashion brand
 * Sophisticated, minimal, editorial. Clothes brand aesthetic.
 */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Syne:wght@500;600;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Agon palette: premium fashion — wine, cream, charcoal */
  --agon-bg: #faf9f7;
  --agon-bg-warm: #f5f3f0;
  --agon-card: #ffffff;
  --agon-brand: #5f364e;
  --agon-brand-light: #7d4d65;
  --agon-brand-dark: #4a2a3d;
  --agon-accent: #8b7355;
  --agon-accent-light: #a89078;
  --agon-cream: #fdfcfa;
  --agon-text: #1a1a1a;
  --agon-text-soft: #4a4a4a;
  --agon-muted: #8a8a8a;
  --agon-border: rgba(95, 54, 78, 0.12);
  --agon-glow: rgba(95, 54, 78, 0.18);
  --agon-shadow: rgba(95, 54, 78, 0.08);
  --agon-error: #c45c5c;
}

@keyframes agon-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes agon-card-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes agon-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes agon-shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes agon-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -10px); }
}

@keyframes agon-float-slow {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(4px, -6px) rotate(1deg); }
  66% { transform: translate(-3px, 4px) rotate(-0.5deg); }
}

@keyframes agon-bg-shift {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

@keyframes agon-glow-pulse {
  0%, 100% { box-shadow: 0 32px 80px rgba(0,0,0,0.06), 0 0 0 1px var(--agon-border); }
  50% { box-shadow: 0 40px 100px rgba(95, 54, 78, 0.06), 0 0 0 1px var(--agon-border); }
}

@keyframes agon-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  25% { transform: translate(3%, -4%) scale(1.05); opacity: 0.65; }
  50% { transform: translate(-2%, 2%) scale(0.95); opacity: 0.55; }
  75% { transform: translate(2%, 3%) scale(1.02); opacity: 0.6; }
}

@keyframes agon-bg-drift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}

/* Base: rich gradient mesh */
body.agon-auth {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    linear-gradient(145deg, #f8f6f3 0%, #f5f2ee 25%, #faf8f5 50%, #f2efe9 75%, #faf9f7 100%);
}

body.agon-auth::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(95, 54, 78, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 80% 100% at 100% 0%, rgba(139, 115, 85, 0.07) 0%, transparent 48%),
    radial-gradient(ellipse 90% 70% at 100% 100%, rgba(95, 54, 78, 0.05) 0%, transparent 45%),
    radial-gradient(ellipse 70% 90% at 0% 100%, rgba(168, 144, 120, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(255, 252, 248, 0.9) 0%, transparent 70%);
  pointer-events: none;
  animation: agon-bg-drift 12s ease-in-out infinite;
}

/* Subtle fabric-like dot pattern + grain */
.agon-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at center, rgba(95, 54, 78, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.9;
}

.agon-grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Soft blurred orbs — luxury ambient glow */
.agon-bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.agon-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: agon-orb-float 20s ease-in-out infinite;
}

.agon-orb:nth-child(1) {
  width: 320px; height: 320px;
  top: -8%; left: -5%;
  background: radial-gradient(circle, rgba(95, 54, 78, 0.12) 0%, rgba(95, 54, 78, 0.04) 50%, transparent 70%);
  animation-duration: 22s; animation-delay: 0s;
}

.agon-orb:nth-child(2) {
  width: 280px; height: 280px;
  top: 40%; right: -6%;
  background: radial-gradient(circle, rgba(139, 115, 85, 0.1) 0%, rgba(139, 115, 85, 0.03) 50%, transparent 70%);
  animation-duration: 18s; animation-delay: 3s;
}

.agon-orb:nth-child(3) {
  width: 240px; height: 240px;
  bottom: -5%; left: 25%;
  background: radial-gradient(circle, rgba(95, 54, 78, 0.08) 0%, transparent 60%);
  animation-duration: 25s; animation-delay: 6s;
}

.agon-orb:nth-child(4) {
  width: 200px; height: 200px;
  top: 60%; left: -4%;
  background: radial-gradient(circle, rgba(168, 144, 120, 0.09) 0%, transparent 60%);
  animation-duration: 20s; animation-delay: 2s;
}

.agon-orb:nth-child(5) {
  width: 260px; height: 260px;
  top: 15%; right: 20%;
  background: radial-gradient(circle, rgba(95, 54, 78, 0.06) 0%, transparent 55%);
  animation-duration: 24s; animation-delay: 4s;
}

/* Floating geometric shapes — refined, softer */
.agon-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.agon-shape {
  position: absolute;
  border: 1px solid rgba(95, 54, 78, 0.08);
  border-radius: 2px;
  opacity: 0.45;
  animation: agon-float 14s ease-in-out infinite;
}

.agon-shape:nth-child(1) { width: 140px; height: 1px; top: 15%; left: 6%; animation-delay: 0s; animation-duration: 12s; }
.agon-shape:nth-child(2) { width: 90px; height: 1px; top: 78%; right: 10%; animation-delay: 2.5s; animation-duration: 16s; }
.agon-shape:nth-child(3) { width: 70px; height: 1px; bottom: 22%; left: 12%; animation-delay: 5s; animation: agon-float-slow 18s ease-in-out infinite; }
.agon-shape:nth-child(4) { width: 110px; height: 1px; top: 38%; right: 18%; animation-delay: 1s; animation-duration: 13s; }
.agon-shape:nth-child(5) { width: 1px; height: 90px; top: 58%; left: 4%; animation-delay: 3s; animation-duration: 15s; }
.agon-shape:nth-child(6) { width: 1px; height: 70px; top: 18%; right: 6%; animation-delay: 4s; animation: agon-float-slow 14s ease-in-out infinite; }

/* Main card — entrance + subtle ambient pulse */
.agon-login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--agon-card);
  border-radius: 28px;
  overflow: hidden;
  min-height: 580px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.06),
    0 0 0 1px var(--agon-border);
  animation: agon-card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards, agon-glow-pulse 8s ease-in-out 1s infinite;
}

/* —— Left: Brand / Visual —— */
.agon-brand-side {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(165deg, #fdfcfa 0%, #faf8f5 35%, rgba(95, 54, 78, 0.03) 70%, rgba(139, 115, 85, 0.02) 100%);
}

.agon-brand-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 15% 30%, rgba(95, 54, 78, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 70% 90% at 85% 70%, rgba(139, 115, 85, 0.05) 0%, transparent 50%),
    linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  background-size: 100% 100%, 100% 100%, 200% 100%;
  z-index: 0;
}

.agon-brand-side::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    105deg,
    transparent,
    transparent 2px,
    rgba(95, 54, 78, 0.02) 2px,
    rgba(95, 54, 78, 0.02) 3px
  );
  z-index: 0;
  pointer-events: none;
}

.agon-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.agon-brand-content .logo-link {
  display: inline-block;
  margin-bottom: 0;
  animation: agon-fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.agon-brand-content .logo-link:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 4px 20px var(--agon-shadow));
}

.agon-brand-content .logo-link img {
  max-width: 200px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 16px var(--agon-shadow));
}

.agon-brand-visual {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  animation: agon-fade-up 0.7s ease-out 0.1s both;
  box-shadow: 0 20px 50px var(--agon-shadow);
}

.agon-brand-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agon-brand-tagline {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  color: var(--agon-muted);
  margin-top: 28px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: agon-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

/* Decorative corner */
.agon-brand-side .agon-corner {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-right: 2px solid var(--agon-border);
  border-bottom: 2px solid var(--agon-border);
  border-radius: 0 0 12px 0;
  opacity: 0.7;
}

/* —— Right: Form —— */
.agon-form-side {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, #ffffff 0%, #fefdfb 40%, #faf9f7 100%);
  border-left: 1px solid var(--agon-border);
  position: relative;
}

.agon-form-side::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(250, 249, 247, 0.95) 0%, transparent 55%),
    radial-gradient(ellipse 50% 80% at 0% 100%, rgba(95, 54, 78, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.agon-form-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.agon-form-header {
  margin-bottom: 36px;
}

.agon-form-title {
  font-family: 'Syne', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--agon-text);
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  line-height: 1.2;
  animation: agon-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.agon-form-subtitle {
  font-size: 15px;
  color: var(--agon-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  animation: agon-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

/* Input groups */
.agon-input-group {
  margin-bottom: 22px;
  animation: agon-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agon-form-inner form .agon-input-group:nth-child(1) { animation-delay: 0.1s; }
.agon-form-inner form .agon-input-group:nth-child(2) { animation-delay: 0.16s; }

.agon-input-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--agon-text-soft);
  margin-bottom: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.agon-input-wrap {
  position: relative;
  border-radius: 16px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.25s ease;
}

.agon-input-wrap:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--agon-shadow), 0 0 0 1px var(--agon-border);
}

.agon-input-wrap .icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--agon-muted);
  font-size: 20px;
  pointer-events: none;
  transition: color 0.25s ease, transform 0.25s ease;
}

.agon-input-wrap:focus-within .icon {
  color: var(--agon-brand);
  transform: translateY(-50%) scale(1.05);
}

.agon-input-wrap input {
  width: 100%;
  padding: 16px 18px 16px 50px;
  background: var(--agon-cream);
  border: 2px solid var(--agon-border);
  border-radius: 16px;
  color: var(--agon-text);
  font-size: 15px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  outline: none;
}

.agon-input-wrap input::placeholder {
  color: var(--agon-muted);
  font-weight: 400;
}

.agon-input-wrap input:focus {
  border-color: var(--agon-brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--agon-glow);
}

.agon-input-wrap input.is-invalid {
  border-color: var(--agon-error);
}

.agon-toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--agon-muted);
  cursor: pointer;
  font-size: 18px;
  transition: color 0.2s ease;
}

.agon-toggle-password:hover {
  color: var(--agon-brand);
}

.agon-input-wrap.has-toggle input {
  padding-right: 48px;
}

.agon-invalid-feedback {
  color: var(--agon-error);
  font-size: 12px;
  margin-top: 8px;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Remember me */
.agon-remember {
  margin-bottom: 26px;
  animation: agon-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.agon-remember label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--agon-text-soft);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: color 0.2s ease;
}

.agon-remember label:hover {
  color: var(--agon-text);
}

.agon-remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--agon-brand);
  cursor: pointer;
  border-radius: 5px;
}

/* Submit button */
.agon-submit {
  width: 100%;
  padding: 18px 24px;
  background: var(--agon-brand);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(95, 54, 78, 0.38);
  animation: agon-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

.agon-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: agon-shine 4s ease-in-out infinite;
  pointer-events: none;
}

.agon-submit:hover {
  background: var(--agon-brand-light);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 40px rgba(95, 54, 78, 0.42);
}

.agon-submit:hover::before {
  animation: agon-shine 1.2s ease-in-out;
}

.agon-submit:active {
  transform: translateY(-1px) scale(1);
}

/* Alert */
.agon-alert {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: rgba(196, 92, 92, 0.08);
  border: 1px solid rgba(196, 92, 92, 0.2);
  color: var(--agon-error);
  animation: agon-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Responsive */
@media (max-width: 900px) {
  .agon-login-wrap {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: auto;
    border-radius: 20px;
  }

  .agon-brand-side {
    padding: 36px 28px;
    min-height: 200px;
  }

  .agon-brand-content .logo-link img {
    max-width: 140px;
  }

  .agon-brand-visual {
    max-width: 200px;
    margin-top: 8px;
  }

  .agon-brand-tagline {
    font-size: 13px;
    margin-top: 16px;
  }

  .agon-form-side {
    padding: 36px 28px;
    border-left: none;
    border-top: 1px solid var(--agon-border);
  }

  .agon-form-title {
    font-size: 24px;
  }

  .agon-brand-side .agon-corner {
    display: none;
  }
}

@media (max-width: 480px) {
  body.agon-auth {
    padding: 16px;
  }

  .agon-brand-visual {
    display: none;
  }

  .agon-form-title {
    font-size: 22px;
  }

  .agon-brand-side,
  .agon-form-side {
    padding: 28px 20px;
  }

  .agon-shape {
    opacity: 0.3;
  }
}
