/* ==========================================================================
   Avatar Creator — auth.css
   Layout for /login and /signup: a video showcase (1/3) beside the form (2/3).
   ========================================================================== */

.auth {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 2fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Showcase (video panel) ---------- */
.showcase-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: var(--s-4);
}

.showcase {
  position: relative;
  height: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  background: var(--plum);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.showcase__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 600ms var(--ease);
  z-index: 1;
}
.showcase.has-video .showcase__video.is-active { opacity: 1; }
.showcase.has-video .showcase__placeholder,
.showcase.has-video .showcase__caption { display: none; }

/* Placeholder: a soft-focus, slowly moving colour field
   standing in for a real vertical UGC clip. */
.showcase__placeholder {
  position: absolute;
  inset: -10%;
  z-index: 0;
  background:
    radial-gradient(40% 35% at 25% 20%, rgba(255, 199, 176, .85), transparent 70%),
    radial-gradient(45% 40% at 85% 35%, rgba(232, 102, 127, .9), transparent 70%),
    radial-gradient(55% 45% at 50% 95%, rgba(214, 58, 94, .85), transparent 70%),
    radial-gradient(35% 30% at 10% 75%, rgba(233, 201, 168, .6), transparent 70%),
    linear-gradient(160deg, #7A3459, #4A2040 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.02); }
}

/* Film grain + legibility vignette over whatever is playing. */
.showcase::before,
.showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.showcase::before {
  background:
    linear-gradient(180deg, rgba(30, 10, 20, .45) 0%, transparent 22%, transparent 52%, rgba(30, 10, 20, .78) 100%);
}
.showcase::after {
  opacity: .14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.showcase__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--s-6);
}

.showcase__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }

.glass {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 32px;
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .02em;
}
.pill__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rouge-300);
  box-shadow: 0 0 0 0 rgba(242, 149, 167, .7);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(242, 149, 167, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 149, 167, 0); } }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-on { display: none; }
.icon-btn[aria-pressed="true"] .icon-on { display: block; }
.icon-btn[aria-pressed="true"] .icon-off { display: none; }

.showcase__bottom { display: grid; gap: var(--s-5); }

/* UGC-style burned-in caption. */
.showcase__caption {
  margin: 0 auto;
  max-width: 18ch;
  text-align: center;
  font-size: clamp(1.25rem, 1rem + .8vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(30, 10, 20, .45);
  min-height: 2.4em;
  text-wrap: balance;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.showcase__caption mark {
  background: none;
  color: var(--rouge-200);
}
.showcase__caption.is-swapping { opacity: 0; transform: translateY(6px); }

.creator {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-lg);
}
.creator__avatar {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--peach), var(--rouge-400) 60%, var(--rouge-700));
  border: 2px solid rgba(255, 255, 255, .7);
}
.creator__name { font-weight: 600; font-size: var(--text-sm); line-height: 1.2; }
.creator__meta { font-size: var(--text-xs); opacity: .8; }
.creator__tag {
  margin-left: auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  opacity: .95;
  white-space: nowrap;
}

.progress {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .25);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: inherit;
}
.showcase:not(.has-video) .progress span { animation: progress 24s linear infinite; }
@keyframes progress { to { width: 100%; } }

/* ---------- Main (form side) ---------- */
.auth__main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--s-8) clamp(var(--s-6), 4vw, var(--s-16));
  /* clip, not hidden: hidden still scrolls when a field takes focus,
     sliding the column sideways to show the bloom below. */
  overflow: clip;
}
/* A faint blush bloom so the cream doesn't feel flat. */
.auth__main::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -20%;
  right: -15%;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(249, 195, 205, .45), transparent);
  pointer-events: none;
}

.auth__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.auth__switch { font-size: var(--text-sm); color: var(--ink-2); }
.auth__switch a { font-weight: 600; }

.auth__body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--s-8) 0;
}

.auth__card { width: 100%; max-width: 420px; }

.auth__intro { margin-bottom: var(--s-8); }
.auth__intro .eyebrow { display: block; margin-bottom: var(--s-3); }
.auth__intro .lede { margin-top: var(--s-3); font-size: var(--text-md); }

.auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: var(--text-sm);
}
.auth__row a { font-weight: 600; }

.auth__alt { margin-top: var(--s-6); text-align: center; font-size: var(--text-sm); color: var(--ink-2); }
.auth__alt a { font-weight: 600; }
.auth__alt--tight { margin-top: 0; }

/* A button that reads as a link (actions that stay on the page). */
.auth__link {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--rouge-600);
  cursor: pointer;
}
.auth__link:hover { color: var(--rouge-700); text-decoration: underline; }
.auth__link:focus-visible { outline: 2px solid var(--rouge-400); outline-offset: 2px; border-radius: 4px; }

/* Email-code steps */
.form[hidden] { display: none; }
.code__step { display: grid; gap: var(--s-5); }
.code__step[hidden] { display: none; }
.code__step > .hint { margin: 0; }
.input--code { letter-spacing: .4em; font-variant-numeric: tabular-nums; font-size: var(--text-lg); }

.auth__footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.auth__footer a { color: var(--ink-3); }
.auth__footer a:hover { color: var(--rouge-600); }

.btn__icon { width: 18px; height: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .auth { grid-template-columns: minmax(320px, 1fr) 1.4fr; }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .showcase-wrap {
    position: relative;
    height: 300px;
    padding: var(--s-3) var(--s-3) 0;
  }
  .showcase { border-radius: var(--r-lg); }
  .showcase__overlay { padding: var(--s-4); }
  .showcase__caption { font-size: 1.15rem; min-height: 0; }
  .creator { display: none; }
  .auth__main { min-height: 0; padding: var(--s-6) var(--s-4) var(--s-6); }
  .auth__body { padding: var(--s-8) 0; }
  .auth__intro { margin-bottom: var(--s-6); }
}

@media (max-width: 420px) {
  .auth__switch .hide-xs { display: none; }
  .wordmark { font-size: 1.5rem; }
}
