/* ==========================================================================
   RENMAR OPS / PROJECT NEXUS - MODERN LOGIN STYLES
   Glassmorphism, Ambient Orbs, Shake Animation, Success Transitions
   ========================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-dark: #070b14;
  --bg-card: rgba(17, 24, 39, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-highlight: rgba(255, 255, 255, 0.16);
  --input-bg: rgba(15, 23, 42, 0.65);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-text: #f8fafc;
  --input-placeholder: #64748b;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  --primary-glow: rgba(37, 99, 235, 0.35);
  --success-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --success-glow: rgba(16, 185, 129, 0.4);
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.35);
  --danger-text: #fca5a5;
  --danger-accent: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.nexus-login-body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  color: #f1f5f9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Atmosphere & Ambient Lighting */
.login-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: 
    radial-gradient(circle at 12% 15%, rgba(14, 165, 233, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.7) 0%, var(--bg-dark) 100%);
}

.login-grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 85%);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.ambient-orb-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #0284c7 0%, transparent 70%);
  top: -120px;
  left: -100px;
  animation-duration: 22s;
}

.ambient-orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  bottom: -100px;
  right: -80px;
  animation-duration: 26s;
  animation-delay: -5s;
}

.ambient-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: 55%;
  left: 10%;
  animation-duration: 18s;
  animation-delay: -9s;
  opacity: 0.25;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, 30px) scale(1.08);
  }
  100% {
    transform: translate(-30px, 50px) scale(0.95);
  }
}

/* Main Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 460px;
  padding: 24px 20px;
  animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card Styling (Glassmorphism) */
.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-card-highlight);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(14, 165, 233, 0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Header & Brand */
.brand-header {
  text-align: center;
  margin-bottom: 30px;
}

.brand-logo-wrap {
  display: inline-block;
  margin-bottom: 14px;
  position: relative;
}

.brand-logo {
  max-width: 220px;
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s ease;
}

.brand-logo:hover {
  transform: scale(1.02);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseDot 2s infinite;
}

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

/* Alert / Error Banner */
.login-alert {
  display: none;
  align-items: flex-start;
  gap: 12px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 22px;
  animation: slideDownAlert 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-alert.is-visible {
  display: flex;
}

.alert-icon {
  font-size: 17px;
  color: var(--danger-accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.alert-message {
  flex: 1;
}

@keyframes slideDownAlert {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 15px;
  pointer-events: none;
  transition: color 0.25s ease;
  z-index: 2;
}

.form-input {
  width: 100%;
  height: 48px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 0 44px 0 44px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--input-text);
  transition: all 0.25s ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--input-placeholder);
}

.form-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.form-input:focus {
  background: rgba(15, 23, 42, 0.88);
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.input-wrapper:focus-within .input-icon {
  color: #38bdf8;
}

/* Input Error State */
.input-wrapper.has-error .form-input {
  border-color: var(--danger-accent) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22) !important;
}

.input-wrapper.has-error .input-icon {
  color: var(--danger-accent) !important;
}

/* Toggle Password Visibility Button */
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
  z-index: 2;
}

.toggle-password:hover {
  color: #cbd5e1;
  background-color: rgba(255, 255, 255, 0.05);
}

.toggle-password:focus {
  outline: none;
  color: #38bdf8;
}

/* Options Row (Remember / Forgot Password) */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
  margin-bottom: 24px;
  font-size: 13px;
}

.forgot-password-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.forgot-password-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Custom Checkbox */
.remember-me-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.remember-me-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 5px;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.2s ease;
}

.remember-me-checkbox::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #ffffff;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.remember-me-checkbox:checked {
  background: #0284c7;
  border-color: #38bdf8;
}

.remember-me-checkbox:checked::before {
  transform: scale(1);
}

/* Submit Button & Interactive States */
.submit-btn {
  width: 100%;
  height: 50px;
  background: var(--primary-gradient);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 20px -4px var(--primary-glow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(37, 99, 235, 0.5);
  filter: brightness(1.08);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px -2px var(--primary-glow);
}

/* Button Loading State */
.submit-btn.is-loading {
  pointer-events: none;
  opacity: 0.92;
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
}

/* Button Success State */
.submit-btn.is-success {
  pointer-events: none;
  background: var(--success-gradient) !important;
  box-shadow: 0 12px 28px -4px var(--success-glow) !important;
}

.btn-icon {
  font-size: 15px;
  transition: transform 0.25s ease;
}

.submit-btn:hover .btn-icon {
  transform: translateX(3px);
}

/* Checkmark and Spinner Elements inside Button */
.btn-spinner {
  display: none;
  font-size: 17px;
  animation: spin 0.85s linear infinite;
}

.btn-checkmark {
  display: none;
  font-size: 18px;
  animation: checkmarkPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* SHAKE ANIMATION FOR INCORRECT CREDENTIALS */
@keyframes shakeAnimation {
  0%, 100% {
    transform: translateX(0);
  }
  15%, 45%, 75% {
    transform: translateX(-10px);
  }
  30%, 60%, 90% {
    transform: translateX(10px);
  }
}

.shake {
  animation: shakeAnimation 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}

.shake-danger-glow {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(239, 68, 68, 0.25) !important;
}

/* Footer Information */
.login-footer {
  text-align: center;
  margin-top: 26px;
  font-size: 12px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.ssl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 11.5px;
}

.ssl-badge i {
  color: #10b981;
}

/* Responsive Styles */
@media (max-width: 480px) {
  .login-card {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .brand-logo {
    max-width: 190px;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ==========================================================================
   DYNAMIC PANELS & TRANSITIONS (LOGIN <-> RESET <-> CONFIRM)
   ========================================================================== */

.auth-panel {
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-panel.panel-hidden {
  display: none;
  opacity: 0;
  transform: translateX(30px);
}

.auth-panel.panel-active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* Panel Header Typography */
.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
  text-align: center;
}

.panel-description {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 24px;
}

/* Navigation & Back Links */
.panel-footer-nav {
  text-align: center;
  margin-top: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  color: #38bdf8;
  transform: translateX(-3px);
}

.back-link i {
  font-size: 12px;
}

/* Success Box inside Reset Panel */
.reset-success-box {
  display: none;
  text-align: center;
  padding: 10px 0 15px;
  animation: cardEntrance 0.45s ease forwards;
}

.reset-success-box.is-visible {
  display: block;
}

.success-icon-circle {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  font-size: 26px;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
  animation: checkmarkPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.error-icon-circle,
.reset-error-icon,
.reset-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f87171;
  font-size: 26px;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
  animation: checkmarkPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-box-title {
  font-size: 19px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.success-box-desc {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 24px;
}

/* Success Alert (Green) */
.login-alert.alert-success {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #a7f3d0 !important;
}

.login-alert.alert-success .alert-icon {
  color: #10b981 !important;
}

/* Password Requirements Helper */
.password-requirements {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 22px;
  font-size: 12.5px;
  color: #94a3b8;
}

.password-requirements-title {
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.password-requirements-title i {
  color: #38bdf8;
  font-size: 12px;
}

.password-requirements ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.password-requirements li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.password-requirements li i {
  font-size: 10px;
  color: #64748b;
}

.password-requirements li.req-met i {
  color: #10b981;
}

/* Slide Transition Animations */
.slide-out-left {
  animation: slideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-right {
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-right {
  animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-left {
  animation: slideInLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-35px); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(35px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(35px); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-35px); }
  to { opacity: 1; transform: translateX(0); }
}

