/* ============================================================
   Futuristic Auth Pages - Sci-Fi Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Orbitron:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #1E3A8A;
  --primary-dark: #0F172A;
  --primary-deeper: #070E1B;
  --accent: #F97316;
  --accent-hover: #EA580C;
  --accent-glow: rgba(249, 115, 22, 0.4);
  --blue-glow: rgba(59, 130, 246, 0.4);
  --blue-neon: #3B82F6;
  --white: #FFFFFF;
  --text-secondary: #94A3B8;
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(59, 130, 246, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--primary-deeper);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
}

/* ---- PARTICLE CANVAS ---- */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- MAIN LAYOUT ---- */
.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.auth-left {
  width: 35%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  position: relative;
  z-index: 2;
}

.auth-right {
  width: 65%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* ---- GLASS FORM CARD ---- */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  animation: cardSlideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes cardSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--blue-neon), transparent 40%, transparent 60%, var(--accent));
  z-index: -1;
  opacity: 0.3;
  animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
  0% { opacity: 0.2; }
  100% { opacity: 0.5; }
}

/* ---- LOGO / BRAND ---- */
.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand .brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--accent), var(--blue-neon));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  animation: iconPulse 2s ease-in-out infinite;
  box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(249, 115, 22, 0.15);
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px var(--accent-glow); }
  50% { transform: scale(1.05); box-shadow: 0 0 50px var(--accent-glow), 0 0 80px rgba(59, 130, 246, 0.2); }
}

.auth-brand h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--white), var(--blue-neon));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-brand p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
}

/* ---- FORM ELEMENTS ---- */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 18px;
  transition: color 0.3s;
  z-index: 2;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  color: var(--white);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.form-input::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

.form-input:focus {
  border-color: var(--blue-neon);
  box-shadow: 0 0 0 3px var(--blue-glow), 0 0 20px rgba(59, 130, 246, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
  color: var(--blue-neon);
}

.form-input.input-error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.error-text {
  color: #EF4444;
  font-size: 12px;
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 4px;
}

.error-text.visible {
  display: flex;
}

/* ---- PASSWORD TOGGLE ---- */
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: color 0.3s;
  z-index: 2;
}

.password-toggle:hover {
  color: var(--accent);
}

/* ---- CHECKBOX ---- */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.checkbox-wrapper input:checked + .custom-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.checkbox-wrapper input:checked + .custom-checkbox::after {
  content: '✓';
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-label {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---- SUBMIT BUTTON ---- */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow), 0 0 60px rgba(249, 115, 22, 0.2);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
  0%, 100% { transform: rotate(45deg) translateX(-150%); }
  50% { transform: rotate(45deg) translateX(150%); }
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---- LINKS ---- */
.auth-link {
  color: var(--blue-neon);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.auth-link:hover {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.forgot-link {
  text-align: right;
  margin-bottom: 20px;
}

/* ---- RIGHT PANEL IMAGE ---- */
.hero-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-image {
  width: 85%;
  max-width: 600px;
  height: auto;
  border-radius: 20px;
  object-fit: cover;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  filter: brightness(0.9);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.hero-image-container:hover .hero-image {
  filter: brightness(0.5);
  transform: scale(1.02);
}

/* ---- HOVER CIRCLE REVEAL ---- */
.circle-reveal {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.85) 70%, transparent 100%);
  border: 2px solid rgba(59, 130, 246, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 40px var(--blue-glow), 0 0 80px rgba(59, 130, 246, 0.1), inset 0 0 40px rgba(59, 130, 246, 0.05);
}

.circle-reveal.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.circle-reveal::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--blue-neon), var(--accent), var(--blue-neon));
  z-index: -1;
  opacity: 0.4;
  animation: circleRotate 4s linear infinite;
}

@keyframes circleRotate {
  to { transform: rotate(360deg); }
}

.circle-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.circle-count {
  font-family: 'Orbitron', sans-serif;
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--blue-neon));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}

.circle-count-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.circle-templates {
  display: flex;
  gap: 8px;
}

.circle-templates img {
  width: 70px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(59, 130, 246, 0.3);
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.circle-templates img:hover {
  transform: scale(1.15);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ---- SCANNER LINE ---- */
.scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-neon), transparent);
  animation: scanLine 3s ease-in-out infinite;
  opacity: 0.6;
  z-index: 5;
}

@keyframes scanLine {
  0% { top: 0; opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

/* ---- FLOATING SYMBOLS ---- */
.floating-symbols {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-symbol {
  position: absolute;
  font-size: 20px;
  opacity: 0.08;
  animation: floatSymbol linear infinite;
  color: var(--blue-neon);
}

@keyframes floatSymbol {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.08; }
  90% { opacity: 0.08; }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* ---- SPECTACULAR SPINNER ---- */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 14, 27, 0.85);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.spinner-overlay.active {
  display: flex;
}

.spinner-container {
  text-align: center;
}

.spinner-rings {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.spinner-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
}

.spinner-ring:nth-child(1) {
  inset: 0;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: spinRing1 1.2s linear infinite;
}

.spinner-ring:nth-child(2) {
  inset: 12px;
  border-bottom-color: var(--blue-neon);
  border-left-color: var(--blue-neon);
  animation: spinRing2 1.5s linear infinite;
}

.spinner-ring:nth-child(3) {
  inset: 24px;
  border-top-color: var(--accent);
  animation: spinRing3 1s linear infinite;
}

.spinner-center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  animation: spinnerPulse 1.5s ease-in-out infinite;
}

@keyframes spinRing1 { to { transform: rotate(360deg); } }
@keyframes spinRing2 { to { transform: rotate(-360deg); } }
@keyframes spinRing3 { to { transform: rotate(360deg); } }
@keyframes spinnerPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
}

.spinner-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 3px;
  animation: textFlicker 2s ease-in-out infinite;
}

@keyframes textFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.spinner-symbols {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.spinner-sym {
  font-size: 22px;
  animation: symBounce 1.5s ease-in-out infinite;
}

.spinner-sym:nth-child(1) { animation-delay: 0s; }
.spinner-sym:nth-child(2) { animation-delay: 0.15s; }
.spinner-sym:nth-child(3) { animation-delay: 0.3s; }
.spinner-sym:nth-child(4) { animation-delay: 0.45s; }
.spinner-sym:nth-child(5) { animation-delay: 0.6s; }

@keyframes symBounce {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.5; }
  50% { transform: translateY(-15px) scale(1.3); opacity: 1; }
}

/* ---- SUCCESS / MESSAGE MODAL ---- */
.message-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 14, 27, 0.85);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.message-modal.active {
  display: flex;
}

.message-box {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.message-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
}

.message-icon.success {
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
}

.message-icon.error {
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}

.message-icon.info {
  background: rgba(59, 130, 246, 0.15);
  border: 2px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.message-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.message-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-modal {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

/* ---- PASSWORD RESET STEPS ---- */
.reset-step {
  display: none;
}

.reset-step.active {
  display: block;
  animation: stepFadeIn 0.4s ease;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.code-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  color: var(--white);
  outline: none;
  transition: all 0.3s;
}

.code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(249, 115, 22, 0.15);
}

/* ---- GRID BACKGROUND ---- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .auth-container {
    flex-direction: column;
  }
  .auth-left {
    width: 100%;
    min-height: auto;
    padding: 30px 20px;
    order: 1;
  }
  .auth-right {
    width: 100%;
    min-height: 350px;
    order: 0;
  }
  .hero-image {
    width: 70%;
    max-width: 400px;
  }
  .circle-reveal {
    width: 280px;
    height: 280px;
  }
  .circle-count {
    font-size: 36px;
  }
  .circle-templates img {
    width: 55px;
    height: 40px;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 28px 22px;
    border-radius: 18px;
  }
  .auth-brand h1 {
    font-size: 18px;
  }
  .hero-image {
    width: 85%;
  }
  .circle-reveal {
    width: 220px;
    height: 220px;
  }
  .circle-count {
    font-size: 28px;
  }
  .circle-title {
    font-size: 11px;
  }
  .circle-templates img {
    width: 45px;
    height: 32px;
  }
  .code-input {
    width: 40px;
    height: 48px;
    font-size: 18px;
  }
}