/**
 * ====================================================================================================
 *   NIGAMA CONNECT ADMIN PORTAL — LUXURY 3D HOLOGRAPHIC SECURITY VAULT & LOGIN STYLING
 *   File: css/v5/style.css
 *   Architecture: CSS3 3D Spatial Perspective, Luxury Glassmorphism & Micro-Interactions
 *   Reference: webofficial_appnigamaconnect/security & webapp_enhancement_prompt 1A/2
 * ====================================================================================================
 */

/* ----------------------------------------------------------------------------------------------------
 * 1. GLOBAL BASE & RESET
 * ---------------------------------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--nc-font-sans, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif);
  background-color: var(--nc-bg-main, #020617);
  background-image: var(--nc-bg-radial, radial-gradient(circle at 50% 0%, #0B1933 0%, #020617 85%));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  color: var(--nc-text-primary, #F8FAFC);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------------------------------------------------------------------
 * 2. 3D COSMIC BACKGROUND ANIMATION & NEBULA ORBS
 * ---------------------------------------------------------------------------------------------------- */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: cosmicDrift 24s infinite ease-in-out alternate;
  will-change: transform;
}

.circle-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -100px;
  background: radial-gradient(circle, var(--nc-brand-primary, #0FA3D9) 0%, transparent 70%);
  animation-delay: 0s;
}

.circle-2 {
  width: 600px;
  height: 600px;
  bottom: -200px;
  right: -150px;
  background: radial-gradient(circle, var(--nc-brand-secondary, #10B981) 0%, transparent 70%);
  animation-delay: -6s;
}

.circle-3 {
  width: 400px;
  height: 400px;
  top: 40%;
  left: 55%;
  background: radial-gradient(circle, var(--nc-brand-gold, #F59E0B) 0%, transparent 75%);
  opacity: 0.15;
  animation-delay: -12s;
}

@keyframes cosmicDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(60px, 40px) scale(1.15);
  }
  100% {
    transform: translate(-40px, 80px) scale(0.9);
  }
}

/* Subtle Cryptographic Grid Overlay */
.background-animation::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.7;
}

/* ----------------------------------------------------------------------------------------------------
 * 2.1 3D VAULT WEBGL CANVAS
 * ---------------------------------------------------------------------------------------------------- */
.vault-3d-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ----------------------------------------------------------------------------------------------------
 * 3. 3D PERSPECTIVE LOGIN CONTAINER
 * ---------------------------------------------------------------------------------------------------- */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 460px;
  padding: 24px;
  perspective: 1200px;
  animation: vaultEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes vaultEntrance {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ----------------------------------------------------------------------------------------------------
 * 4. LUXURY GLASSMORPHIC SECURITY CARD (.login-card)
 * ---------------------------------------------------------------------------------------------------- */
.login-card {
  background: rgba(11, 21, 40, 0.82);
  border-radius: 28px;
  padding: 44px 38px;
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.75),
              0 0 50px -10px var(--nc-brand-primary-glow, rgba(15, 163, 217, 0.35)),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.login-card:hover {
  border-color: rgba(15, 163, 217, 0.4);
  box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.85),
              0 0 60px -5px var(--nc-brand-primary-glow, rgba(15, 163, 217, 0.45)),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Dynamic Vault Laser Scan Beam */
.nc-vault-laser-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--nc-brand-secondary, #10B981), var(--nc-brand-primary, #0FA3D9), transparent);
  box-shadow: 0 0 15px var(--nc-brand-secondary, #10B981), 0 0 25px var(--nc-brand-primary, #0FA3D9);
  animation: laserScan 4.5s ease-in-out infinite;
  opacity: 0.9;
  border-radius: 9999px;
  pointer-events: none;
}

@keyframes laserScan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Glowing Top Laser Specular Highlight */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--nc-brand-primary, #0FA3D9), var(--nc-brand-secondary, #10B981), transparent);
  border-radius: var(--nc-radius-full, 9999px);
  filter: drop-shadow(0 0 8px var(--nc-brand-primary, #0FA3D9));
}

/* ----------------------------------------------------------------------------------------------------
 * 5. BRAND LOGO & 3D HOLOGRAM SHIELD STAGE
 * ---------------------------------------------------------------------------------------------------- */
.logo-section {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.nc-hologram-shield-stage {
  width: 110px;
  height: 110px;
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 auto 16px auto;
}

.nc-shield-ring-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(16, 185, 129, 0.45);
  animation: spinSlow 22s linear infinite;
}

.nc-shield-ring-inner {
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  border: 2px solid rgba(15, 163, 217, 0.35);
  animation: spinSlow 14s linear infinite reverse;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.nc-shield-padlock-icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(15, 163, 217, 0.18));
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  display: grid;
  place-items: center;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.35);
  position: relative;
  z-index: 2;
  transition: transform 0.3s var(--nc-ease-spring, cubic-bezier(0.175, 0.885, 0.32, 1.275));
}

.nc-shield-padlock-icon:hover {
  transform: scale(1.08) rotate(3deg);
}

.logo {
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(15, 163, 217, 0.7));
}

.security-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--nc-radius-full, 9999px);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: var(--nc-brand-secondary, #10B981);
  font-family: var(--nc-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 10px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--nc-brand-secondary, #10B981);
  box-shadow: 0 0 10px var(--nc-brand-secondary, #10B981);
  animation: pulseRing 2s infinite ease-in-out;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.company-name {
  font-family: var(--nc-font-display, 'Outfit', sans-serif);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 40%, var(--nc-brand-primary, #0FA3D9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.welcome-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--nc-text-secondary, #94A3B8);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------------------------------------------
 * 6. ALERT BOX & TELEMETRY TOAST
 * ---------------------------------------------------------------------------------------------------- */
.alert-box {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.alert-box.show {
  display: flex;
}

.error-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
}

.alert-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------------------------------------------
 * 7. FORM GROUPS & FLOATING GLASS INPUTS
 * ---------------------------------------------------------------------------------------------------- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--nc-text-secondary, #94A3B8);
  letter-spacing: 0.02em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid var(--nc-border-glass, rgba(255, 255, 255, 0.12));
  border-radius: 14px;
  transition: all 0.25s var(--nc-ease-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}

.input-wrapper:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(2, 6, 23, 0.8);
}

.input-wrapper:focus-within {
  border-color: var(--nc-brand-primary, #0FA3D9);
  background: rgba(11, 21, 40, 0.95);
  box-shadow: 0 0 25px -3px var(--nc-brand-primary-glow, rgba(15, 163, 217, 0.45));
}

.input-icon {
  width: 19px;
  height: 19px;
  stroke: var(--nc-text-muted, #64748B);
  margin-left: 16px;
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}

.input-wrapper:focus-within .input-icon {
  stroke: var(--nc-brand-primary, #0FA3D9);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--nc-text-primary, #F8FAFC);
}

.form-input::placeholder {
  color: var(--nc-text-dim, #475569);
}

/* Password Reveal Button */
.toggle-password {
  background: transparent;
  border: none;
  padding: 0 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--nc-text-muted, #64748B);
  transition: color 0.2s ease, transform 0.2s ease;
}

.toggle-password:hover {
  color: var(--nc-text-primary, #F8FAFC);
  transform: scale(1.1);
}

.eye-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Validation Error State */
.input-wrapper.error {
  border-color: var(--nc-brand-danger, #EF4444);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
  animation: shake 0.45s ease;
}

.error-message {
  font-size: 0.78rem;
  color: #F87171;
  font-weight: 500;
  min-height: 18px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ----------------------------------------------------------------------------------------------------
 * 8. FORM OPTIONS (REMEMBER ME & FORGOT PASSWORD)
 * ---------------------------------------------------------------------------------------------------- */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--nc-text-secondary, #94A3B8);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
  background: var(--nc-brand-primary, #0FA3D9);
  border-color: var(--nc-brand-primary, #0FA3D9);
  box-shadow: 0 0 10px var(--nc-brand-primary-glow, rgba(15, 163, 217, 0.5));
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
  content: '✓';
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}

.forgot-password {
  font-size: 0.86rem;
  color: var(--nc-brand-primary, #0FA3D9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: var(--nc-brand-primary-hover, #0284C7);
  text-decoration: underline;
}

/* ----------------------------------------------------------------------------------------------------
 * 9. MAGNETIC SUBMIT BUTTON (.login-button)
 * ---------------------------------------------------------------------------------------------------- */
.login-button {
  width: 100%;
  padding: 15px 24px;
  margin-top: 10px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--nc-brand-primary, #0FA3D9) 0%, #0284C7 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 25px rgba(15, 163, 217, 0.45);
  transition: all 0.25s var(--nc-ease-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 35px rgba(15, 163, 217, 0.65);
}

.login-button:active {
  transform: scale(0.97);
}

/* Tactile Shimmer Light Sweep on Button */
.login-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  transition: none;
}

.login-button:hover::after {
  left: 140%;
  transition: left 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}

/* Liquid Light Shimmer Effect */
.login-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
  transform: rotate(30deg) translateY(-100%);
  transition: transform 0.6s ease;
}

.login-button:hover::after {
  transform: rotate(30deg) translateY(100%);
}

/* Spinner */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

.spinner.show {
  display: inline-block;
}

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

/* ----------------------------------------------------------------------------------------------------
 * 10. CARD FOOTER
 * ---------------------------------------------------------------------------------------------------- */
.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.78rem;
  color: var(--nc-text-dim, #475569);
  letter-spacing: 0.03em;
}

/* ----------------------------------------------------------------------------------------------------
 * 11. RESPONSIVE ADAPTATIONS
 * ---------------------------------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px;
    border-radius: 20px;
  }
  
  .company-name {
    font-size: 1.55rem;
  }
}
