/* ============================================
   HGLIS Intelligence Map - Login Page Styles
   Premium Glassmorphism Design
   ============================================ */

:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent: #10b981;
  --bg-dark: #0f0f1a;
  --bg-card: rgba(255, 255, 255, 0.95);
  --text-light: rgba(255, 255, 255, 0.9);
  --text-muted-light: rgba(255, 255, 255, 0.6);
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --error: #ef4444;
}

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

body {
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  min-height: 100vh;
  background: var(--bg-dark);
  overflow-x: hidden;
}

/* ========== Animated Background ========== */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(102, 126, 234, 0.4) 0%,
    transparent 70%
  );
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(118, 75, 162, 0.35) 0%,
    transparent 70%
  );
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(16, 185, 129, 0.2) 0%,
    transparent 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

.grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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: 60px 60px;
  animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(60px, 60px);
  }
}

/* ========== Main Container ========== */
.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ========== Branding Section ========== */
.branding-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.brand-content {
  max-width: 500px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 60px;
}

.logo-icon {
  position: relative;
  width: 80px;
  height: 80px;
  background: var(--primary-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.map-icon {
  font-size: 40px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary);
  border-radius: 20px;
  animation: pulse 2s ease-out infinite;
}

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

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.logo-text h1 {
  font-size: 48px;
  font-weight: 900;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.logo-main {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 4px;
}

/* Feature List */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 60px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(10px);
  border-color: rgba(102, 126, 234, 0.3);
}

.feature-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.feature-text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}

.feature-text p {
  font-size: 14px;
  color: var(--text-muted-light);
  line-height: 1.5;
}

/* Version Info */
.version-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.version-badge {
  background: var(--primary-gradient);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
}

.version-text {
  font-size: 14px;
  color: var(--text-muted-light);
}

/* ========== Login Section ========== */
.login-section {
  width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-light);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.lock-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.login-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.login-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Form Styles */
.login-form {
  margin-bottom: 32px;
}

.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 50px 16px 18px;
  font-size: 16px;
  font-family: "Pretendard", sans-serif;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-dark);
  transition: all 0.3s ease;
  letter-spacing: 2px;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-wrapper input::placeholder {
  color: #94a3b8;
  letter-spacing: 0;
}

.toggle-visibility {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-visibility svg {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  transition: color 0.2s;
}

.toggle-visibility:hover svg {
  color: var(--primary);
}

.error-message {
  margin-top: 10px;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-message:not(:empty)::before {
  content: "⚠";
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 18px 24px;
  background: var(--primary-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: "Pretendard", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover::before {
  left: 100%;
}

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

.btn-icon {
  transition: transform 0.3s ease;
}

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

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
  opacity: 0;
}

.btn-loader {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  opacity: 0;
  animation: none;
}

.submit-btn.loading .btn-loader {
  opacity: 1;
  animation: spin 0.8s linear infinite;
}

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

/* Footer */
.login-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.shield-icon {
  font-size: 16px;
}

.contact-info {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== Shake Animation for Error ========== */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-6px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(6px);
  }
}

.input-wrapper.error input {
  border-color: var(--error);
  animation: shake 0.5s ease-in-out;
}

/* ========== Success Animation ========== */
.login-card.success {
  animation: successPulse 0.6s ease;
}

@keyframes successPulse {
  0% {
    box-shadow: var(--shadow-xl);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(16, 185, 129, 0.2),
      var(--shadow-xl);
  }
  100% {
    box-shadow: var(--shadow-xl);
  }
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
  .login-container {
    flex-direction: column;
  }

  .branding-section {
    padding: 40px 30px;
  }

  .login-section {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-light);
  }

  .logo-text h1 {
    font-size: 36px;
  }

  .feature-list {
    margin-bottom: 40px;
  }
}

@media (max-width: 600px) {
  .branding-section {
    padding: 30px 20px;
  }

  .logo-wrapper {
    flex-direction: column;
    text-align: center;
    margin-bottom: 40px;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }

  .map-icon {
    font-size: 30px;
  }

  .logo-text h1 {
    font-size: 32px;
  }

  .feature-item {
    padding: 16px;
  }

  .feature-icon {
    font-size: 24px;
  }

  .login-section {
    padding: 30px 20px;
  }

  .login-card {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .login-header h2 {
    font-size: 20px;
  }
}
