/* Theme Spectrums */

:root,
[data-color="amber"] {
  --lamp-accent: #ffab3d;
  --lamp-glow: #ffe194;
  --lamp-secondary: #d48b28;
  --beam-color: rgba(255, 185, 75, 0.22);
  --beam-start: rgba(255, 220, 130, 0.45);
  --beam-mid: rgba(255, 195, 90, 0.22);
  --beam-far: rgba(255, 175, 60, 0.08);
  --lamp-focus-glow: rgba(255, 171, 61, 0.18);

  --bg-dark: #0c0e12;
  --bg-illuminated: #161920;
  --card-bg: rgba(18, 22, 28, 0.72);
  --card-border: rgba(255, 255, 255, 0.09);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f3f8;
  --text-muted: #8b95a5;
  --text-dim: #545c6b;
}

[data-color="cyan"] {
  --lamp-accent: #00f0ff;
  --lamp-glow: #a6f9ff;
  --lamp-secondary: #009eb0;
  --beam-color: rgba(0, 240, 255, 0.2);
  --beam-start: rgba(160, 245, 255, 0.45);
  --beam-mid: rgba(0, 220, 255, 0.22);
  --beam-far: rgba(0, 180, 220, 0.08);
  --lamp-focus-glow: rgba(0, 240, 255, 0.18);
}

[data-color="rose"] {
  --lamp-accent: #ff3385;
  --lamp-glow: #ffa3c7;
  --lamp-secondary: #ba1656;
  --beam-color: rgba(255, 51, 133, 0.2);
  --beam-start: rgba(255, 160, 205, 0.45);
  --beam-mid: rgba(255, 70, 150, 0.22);
  --beam-far: rgba(255, 30, 110, 0.08);
  --lamp-focus-glow: rgba(255, 51, 133, 0.18);
}

[data-color="mint"] {
  --lamp-accent: #00e676;
  --lamp-glow: #b9f6ca;
  --lamp-secondary: #00964b;
  --beam-color: rgba(0, 230, 118, 0.2);
  --beam-start: rgba(180, 255, 215, 0.45);
  --beam-mid: rgba(0, 225, 115, 0.22);
  --beam-far: rgba(0, 170, 85, 0.08);
  --lamp-focus-glow: rgba(0, 230, 118, 0.18);
}

[data-color="moonlight"] {
  --lamp-accent: #d8e5ff;
  --lamp-glow: #ffffff;
  --lamp-secondary: #7b9cd4;
  --beam-color: rgba(200, 220, 255, 0.22);
  --beam-start: rgba(255, 255, 255, 0.45);
  --beam-mid: rgba(210, 230, 255, 0.22);
  --beam-far: rgba(170, 200, 245, 0.08);
  --lamp-focus-glow: rgba(216, 229, 255, 0.2);
}

/* Global Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.8s ease;
  user-select: none;
}

body[data-on="true"] {
  background-color: var(--bg-illuminated);
}

/* Ambient Radial Glow on Room Wall */
.ambient-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 38% 38%, var(--beam-color), transparent 65%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.8s ease, background 0.5s ease;
}

body[data-on="true"] .ambient-glow {
  opacity: 0.85;
}

/* Dust Particles Canvas */
#dustCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Minimal Controls in Corner */
.quick-controls {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Minimal Color Palette */
.color-palette {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 6px 12px;
  border-radius: 30px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.color-dot-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dot-color);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  outline: none;
}

.color-dot-btn:hover {
  transform: scale(1.22);
  box-shadow: 0 0 10px var(--dot-color);
}

.color-dot-btn.active {
  transform: scale(1.2);
  border-color: #fff;
  box-shadow: 0 0 12px var(--dot-color);
}

.sound-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.sound-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: scale(1.05);
}

.sound-icon {
  width: 18px;
  height: 18px;
}

.hidden {
  display: none !important;
}

/* Scene Layout */
.scene-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 10;
  max-width: 1160px;
  margin: 0 auto;
  gap: 2rem;
}

/* Lamp Stage */
.lamp-stage {
  flex: 1 1 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.lamp-wrapper {
  position: relative;
  width: 400px;
  height: 520px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lamp-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.6));
  transition: filter 500ms ease, transform 500ms cubic-bezier(.2, .7, .2, 1);
  transform-origin: 54% 44%;
}

.lamp-wrapper:hover .lamp-svg {
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.55));
}

.lamp-shade-body {
  transition: filter 500ms ease;
}

body[data-on="true"] .lamp-shade-body {
  filter: drop-shadow(0 0 12px var(--lamp-accent));
}

.shade-enamel-highlight,
.reflector-detail {
  pointer-events: none;
}

.reflector-detail {
  opacity: .7;
  transition: opacity 400ms ease;
}

body[data-on="true"] .reflector-detail {
  opacity: .95;
}

/* Volumetric Light Beam (Inside SVG) */
.svg-light-beam {
  opacity: 0;
  visibility: hidden;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

body[data-on="true"] .svg-light-beam {
  opacity: 1;
  visibility: visible;
}

body[data-on="true"] .svg-light-beam {
  animation: beam-bloom 1.4s ease-out both;
}

@keyframes beam-bloom {
  from {
    opacity: .15;
  }

  to {
    opacity: 1;
  }
}

/* Shade Reflector States */
.shade-reflector-off {
  opacity: 1;
}

.shade-reflector-on {
  opacity: 0;
  transition: opacity 0.35s ease;
}

body[data-on="true"] .shade-reflector-on {
  opacity: 1;
}

/* Bulb Glow */
.bulb-glow-core {
  opacity: 0;
  transition: opacity 0.3s ease;
}

body[data-on="true"] .bulb-glow-core {
  opacity: 0.95;
  animation: bulb-flicker-in 650ms ease-out both;
}

@keyframes bulb-flicker-in {
  0% {
    opacity: 0;
  }

  22% {
    opacity: .55;
  }

  34% {
    opacity: .28;
  }

  48% {
    opacity: .9;
  }

  62% {
    opacity: .72;
  }

  100% {
    opacity: .95;
  }
}

.bulb-filament {
  stroke: #555;
  transition: stroke 0.3s ease, filter 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {

  .lamp-svg,
  .lamp-shade-body,
  .reflector-detail,
  .svg-light-beam,
  .bulb-glow-core,
  .bead-aura,
  .cord-tooltip {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

body[data-on="true"] .bulb-filament {
  stroke: #fff;
  filter: drop-shadow(0 0 6px var(--lamp-accent));
}

/* Elastic String & Bead Handle */
.elastic-cord-path {
  transition: stroke 0.3s ease;
}

body[data-on="true"] .elastic-cord-path {
  stroke: var(--lamp-glow);
  filter: drop-shadow(0 0 4px var(--lamp-accent));
}

.cord-bead-group {
  cursor: grab;
  touch-action: none;
}

.cord-bead-group:active {
  cursor: grabbing;
}

.bead-aura {
  transition: opacity 0.3s ease;
}

body[data-on="true"] .bead-aura {
  opacity: 0.35;
  animation: pulseAura 2.2s infinite ease-in-out;
}

@keyframes pulseAura {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.25;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
}

/* Pull Tooltip */
.cord-tooltip {
  position: absolute;
  top: 360px;
  left: 175px;
  background: rgba(16, 19, 25, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  animation: floatTooltip 2.2s infinite ease-in-out;
  transition: opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
}

body[data-on="true"] .cord-tooltip {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.tooltip-arrow {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(16, 19, 25, 0.88);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

@keyframes floatTooltip {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Form Stage */
.form-stage {
  flex: 1 1 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 520px;
}

/* Login Card */
.login-card {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  width: 100%;
  max-width: 410px;
  background: var(--card-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 2.5rem 2.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  transform: translateY(24px) scale(0.96);
  z-index: 10;
}

body[data-on="true"] .login-card {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  box-shadow:
    -20px 0 60px -15px var(--beam-color),
    0 30px 65px rgba(0, 0, 0, 0.55),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* OFF State Priority */
body[data-on="false"] .login-card {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body[data-on="false"] .svg-light-beam {
  opacity: 0 !important;
  visibility: hidden !important;
}

body[data-on="false"] .ambient-glow {
  opacity: 0 !important;
  visibility: hidden !important;
}

body[data-on="false"] .shade-reflector-on {
  opacity: 0 !important;
}

body[data-on="false"] .bulb-glow-core {
  opacity: 0 !important;
}

body[data-on="false"] .bulb-filament {
  stroke: #555 !important;
  filter: none !important;
}

/* Card Header */
.card-header {
  margin-bottom: 1.6rem;
  text-align: center;
}

.card-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.35rem;
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Tabs: Sign In / Sign Up */
.auth-tabs {
  position: relative;
  display: flex;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1.6rem;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 9px 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s ease;
  text-align: center;
}

.auth-tab.active {
  color: #fff;
}

.tab-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-tabs[data-active="register"] .tab-slider {
  transform: translateX(100%);
}

/* Form Groups */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.label-row label {
  margin-bottom: 0;
}

.forgot-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--lamp-accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.forgot-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 15px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-wrapper:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.input-wrapper:focus-within {
  border-color: var(--lamp-accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--lamp-focus-glow);
}

.field-icon {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.3s ease;
}

.input-wrapper:focus-within .field-icon {
  color: var(--lamp-accent);
}

.input-wrapper input {
  width: 100%;
  padding: 13px 42px 13px 44px;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 500;
}

.input-wrapper input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.eye-toggle {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.eye-toggle:hover {
  color: #fff;
}

.eye-icon {
  width: 18px;
  height: 18px;
}

/* Options */
.options-row {
  margin-bottom: 1.4rem;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.custom-checkbox input {
  display: none;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.checkbox-box svg {
  width: 12px;
  height: 12px;
  color: #121417;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-checkbox input:checked+.checkbox-box {
  background: var(--lamp-accent);
  border-color: var(--lamp-accent);
}

.custom-checkbox input:checked+.checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.checkbox-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Submit Button */
.submit-btn {
  position: relative;
  width: 100%;
  padding: 14px;
  border-radius: 15px;
  border: none;
  background: linear-gradient(135deg, var(--lamp-accent) 0%, var(--lamp-secondary) 100%);
  color: #0b0d10;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -5px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 171, 61, 0.25);
}

.submit-btn:active {
  transform: translateY(0);
}

.btn-glow-layer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
}

.submit-btn:hover .btn-glow-layer {
  left: 150%;
}

.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.submit-btn:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-success-icon {
  width: 22px;
  height: 22px;
  color: #000;
}

/* Divider & Socials */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.5rem 0 1.1rem 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.divider-text {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.social-row {
  display: flex;
  gap: 10px;
}

.social-btn {
  flex: 1;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.social-btn svg {
  width: 19px;
  height: 19px;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Success Overlay */
.success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 24, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  padding: 2.5rem;
  z-index: 30;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.success-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(46, 213, 115, 0.3);
  box-shadow: 0 0 20px rgba(46, 213, 115, 0.2);
}

.success-ring svg {
  width: 30px;
  height: 30px;
}

.success-box h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.success-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.4rem;
}

.reset-demo-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 9px 22px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reset-demo-btn:hover {
  background: #fff;
  color: #000;
}

/* Responsive */
@media (max-width: 960px) {
  .scene-container {
    flex-direction: column;
    padding-top: 60px;
    gap: 1.5rem;
  }

  .lamp-stage {
    flex: 0 0 auto;
    height: 340px;
  }

  .lamp-wrapper {
    width: 320px;
    height: 380px;
    transform: scale(0.9);
  }

  .form-stage {
    width: 100%;
    min-height: auto;
  }

  .login-card {
    max-width: 100%;
    padding: 2rem 1.8rem;
  }
}

@media (max-width: 480px) {
  .scene-container {
    padding: 40px 1rem 1.5rem 1rem;
  }

  .login-card {
    border-radius: 24px;
    padding: 1.8rem 1.3rem;
  }

  .card-title {
    font-size: 1.5rem;
  }
}