/* Sign-in page: CSS-only 3D turntable + canvas sound-wave terrain (login.js). */
:root {
  color-scheme: dark;
  --bg: #07080c; --panel: #12151c; --line: rgba(255, 255, 255, .08);
  --text: #eef0f4; --muted: #9aa3b2; --gold: #e6c477; --gold-2: #f6dc9f;
  --violet: #8f7cff; --danger: #f48a95;
  --size: min(400px, 32vw);
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 15px/1.5 "Manrope", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Background ---------- */
.wave-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.glow { position: fixed; z-index: 0; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .5; }
.glow-gold { width: 520px; height: 520px; left: -160px; top: -180px; background: radial-gradient(circle, #e6c47766, transparent 70%); }
.glow-violet { width: 620px; height: 620px; right: -200px; bottom: -240px; background: radial-gradient(circle, #8f7cff55, transparent 70%); }

.login-shell {
  position: relative; z-index: 1; min-height: 100vh; max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 420px); align-items: center;
  gap: clamp(28px, 5vw, 72px); padding: 32px clamp(20px, 4vw, 56px);
}

/* ---------- 3D stage ---------- */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 28px; min-width: 0; }
.scene { position: relative; width: var(--size); height: calc(var(--size) * .82); perspective: 1100px; }
.scene::after { /* soft floor shadow */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -6%; height: 22%;
  background: radial-gradient(ellipse at center, #000c, transparent 70%); filter: blur(14px); z-index: -1;
}
.turntable {
  position: absolute; left: 0; top: -6%; width: var(--size); height: var(--size);
  transform-style: preserve-3d; transform: rotateX(58deg) rotateZ(-28deg);
  animation: hover 9s ease-in-out infinite;
}
.platter {
  position: absolute; inset: -4%; border-radius: 50%;
  background: radial-gradient(circle, #1b1e27 0 60%, #11131a 61% 100%);
  border: 1px solid #ffffff14; transform: translateZ(-16px);
  box-shadow: 0 0 0 10px #0c0e13, 0 0 90px #e6c47733, 0 40px 80px #000a;
}
.vinyl {
  position: absolute; inset: 7%; border-radius: 50%; transform: translateZ(2px);
  background:
    repeating-radial-gradient(circle, #0b0c10 0 1.6px, #191b23 2.2px 3.4px);
  box-shadow: inset 0 0 0 2px #23252e, inset 0 0 40px #000;
  animation: spin 4.8s linear infinite;
}
.vinyl-shine { /* counter-rotates so the light stays still while the record spins */
  position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: screen;
  background: conic-gradient(from 20deg, transparent 0 12%, #ffffff1f 16%, transparent 22% 58%, #e6c4772b 63%, transparent 70%);
  animation: spin 4.8s linear infinite reverse;
}
.vinyl-label {
  position: absolute; inset: 33%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 45%, #b48a3e 100%);
  box-shadow: 0 0 0 4px #0c0d11, 0 0 30px #e6c47755;
}
.vinyl-label::after { content: ""; position: absolute; width: 9%; height: 9%; border-radius: 50%; background: #0c0d11; }
.vinyl-label svg { width: 42%; height: 42%; fill: none; stroke: #3a2c10; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }

.eq-ring { position: absolute; inset: 0; transform-style: preserve-3d; }
.eq-ring span {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d;
  transform: rotateZ(calc(var(--i) * 9deg)) translateY(calc(var(--size) * -.555)) rotateX(-90deg);
}
.eq-ring b {
  position: absolute; left: -3px; bottom: 0; width: 6px; height: calc(var(--size) * .2);
  border-radius: 3px; transform-origin: bottom; transform-style: preserve-3d;
  background: linear-gradient(to top, var(--gold), var(--violet));
  box-shadow: 0 0 14px #8f7cff55;
  animation: eq 1.25s ease-in-out infinite; animation-delay: calc(var(--i) * -.137s);
}
.eq-ring b::before { /* second face: bars stay visible from every angle */
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; transform: rotateY(90deg);
}
.tonearm {
  /* Pivot outside the platter (right end); the head rests on the outer grooves. */
  position: absolute; right: -3%; top: 3%; width: 38%; height: 7px; border-radius: 6px;
  background: linear-gradient(90deg, #8d96a6, #d9dee6); transform-origin: 100% 50%;
  transform: translateZ(22px) rotate(-43deg); box-shadow: 0 0 0 1px #0006;
}
.tonearm::after { /* pivot */
  content: ""; position: absolute; right: -14px; top: -10px; width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f2f4f7, #7d8696); box-shadow: 0 6px 14px #0008;
}
.tonearm i { position: absolute; left: -10px; top: -5px; width: 22px; height: 18px; border-radius: 4px; background: linear-gradient(#e6c477, #a8823d); }

.note { position: absolute; width: 34px; height: 34px; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px currentColor); animation: drift 11s ease-in-out infinite; opacity: 0; }
.note-1 { left: 6%; top: 8%; color: var(--gold); stroke: var(--gold); }
.note-2 { right: 8%; top: 2%; color: var(--violet); stroke: var(--violet); animation-delay: -3s; width: 26px; }
.note-3 { right: 2%; top: 42%; color: var(--gold-2); stroke: var(--gold-2); animation-delay: -6s; width: 28px; }
.note-4 { left: 0; top: 46%; color: var(--violet); stroke: var(--violet); animation-delay: -8.5s; }

.stage-copy { text-align: center; max-width: 470px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #ffffff08; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 #e6c47788; animation: pulse 2s ease-out infinite; }
.stage-copy h2 {
  margin: 16px 0 14px; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.15; letter-spacing: -1.2px; font-weight: 800;
  background: linear-gradient(100deg, #fff 10%, var(--gold-2) 55%, var(--violet) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stage-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stage-points li { font-size: 12px; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: #ffffff06; border: 1px solid var(--line); }
.stage-points li::before { content: "♪"; color: var(--gold); margin-right: 6px; }

/* ---------- Card ---------- */
.login-card {
  position: relative; width: 100%; padding: 36px; border-radius: 24px;
  background: linear-gradient(180deg, #171a23cc, #0e1017d9);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line); box-shadow: 0 30px 90px #000b, inset 0 1px 0 #ffffff10;
}
.login-card::before { /* gradient edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, #e6c47799, transparent 38%, transparent 62%, #8f7cff99);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, #e6c47726, #8f7cff1f); border: 1px solid #e6c47740;
  box-shadow: 0 8px 26px #e6c47722;
}
.bars { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.bars i { width: 4px; height: 100%; border-radius: 2px; background: linear-gradient(to top, var(--gold), var(--gold-2)); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -.35s; } .bars i:nth-child(3) { animation-delay: -.7s; } .bars i:nth-child(4) { animation-delay: -.2s; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.4px; }
.brand span { font-size: 11px; color: var(--muted); letter-spacing: .4px; }
h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -1px; font-weight: 800; }
.sub { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.error { background: #f48a9514; border: 1px solid #f48a954d; color: var(--danger); padding: 11px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .15s; }
.input-wrap input {
  width: 100%; padding: 14px 46px 14px 44px; border-radius: 13px; font: inherit; color: var(--text);
  background: #0a0c11b3; border: 1px solid #ffffff17; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input-wrap input:focus { border-color: #e6c477aa; box-shadow: 0 0 0 4px #e6c4771a; }
.input-wrap:focus-within .input-icon { stroke: var(--gold); }
.reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.reveal:hover { color: var(--text); background: #ffffff0d; }
.reveal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reveal[aria-pressed="true"] { color: var(--gold); }
.caps { margin: 8px 0 0; font-size: 12px; color: #e6bf70; }
.submit {
  position: relative; overflow: hidden; width: 100%; margin-top: 10px; padding: 15px; border: 0; border-radius: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-weight: 750; font-size: 15px; color: #1d170b;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, #d4a54e); box-shadow: 0 12px 34px #e6c47740, inset 0 1px 0 #fff6;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.submit::after { /* light sweep */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, #ffffff73, transparent); transform: skewX(-20deg);
}
.submit:hover { transform: translateY(-1px); box-shadow: 0 16px 40px #e6c47755, inset 0 1px 0 #fff6; }
.submit:hover::after { left: 120%; transition: left .7s ease; }
.submit:hover svg { transform: translateX(3px); }
.submit:disabled { cursor: progress; filter: saturate(.6) brightness(.9); transform: none; }
.foot { margin: 18px 0 0; text-align: center; font-size: 12px; color: #6f7888; }

/* ---------- Animations ---------- */
@keyframes spin { from { transform: translateZ(2px) rotate(0); } to { transform: translateZ(2px) rotate(360deg); } }
@keyframes hover {
  0%, 100% { transform: rotateX(58deg) rotateZ(-28deg) translateZ(0); }
  50% { transform: rotateX(53deg) rotateZ(-22deg) translateZ(18px); }
}
@keyframes eq {
  0%, 100% { transform: scaleY(.22); }
  25% { transform: scaleY(.9); }
  50% { transform: scaleY(.45); }
  75% { transform: scaleY(1); }
}
@keyframes drift {
  0% { opacity: 0; transform: translate3d(0, 30px, 0) rotate(-8deg) scale(.8); }
  15%, 70% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(18px, -90px, 0) rotate(12deg) scale(1.1); }
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #e6c47788; } 80%, 100% { box-shadow: 0 0 0 10px #e6c47700; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --size: min(250px, 62vw); }
  .login-shell { grid-template-columns: minmax(0, 440px); justify-content: center; align-content: center; gap: 8px; padding-top: 44px; }
  .stage { gap: 0; }
  .stage-copy, .note-3, .note-4 { display: none; }
}
@media (max-width: 420px) {
  .login-card { padding: 26px 20px; border-radius: 20px; }
  h1 { font-size: 24px; }
}
@media (max-height: 640px) and (max-width: 960px) { .stage { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .note { opacity: .7; }
}
