/* ===== LOGIN.CSS - TRIAS DLP Professional Login Page ===== */

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Color Variables - TRIAS Palette */
:root {
  --trias-navy: #182c44;
  --trias-teal: #749cac;
  --trias-blue: #4484b0;
  --trias-green: #144c44;
  --trias-purple: #44487c;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --error: #e53e3e;
  --warning: #d69e2e;
  --success: #38a169;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(24, 44, 68, 0.05);
  --shadow-md: 0 2px 4px 0 rgba(24, 44, 68, 0.1);
  --shadow-lg: 0 4px 8px 0 rgba(24, 44, 68, 0.1);
  --shadow-xl: 0 8px 16px 0 rgba(24, 44, 68, 0.15);
}

/* Body and HTML */
html, body {
  height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #182c44;
  position: relative;
  overflow-x: hidden;
}

/* Geometric Pattern Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='grid' width='20' height='20' patternUnits='userSpaceOnUse'%3E%3Cpath d='M 20 0 L 0 0 0 20' fill='none' stroke='%23749cac' stroke-width='0.5' opacity='0.3'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23grid)'/%3E%3Cg opacity='0.2'%3E%3Cpolygon points='50,10 90,50 50,90 10,50' fill='none' stroke='%234484b0' stroke-width='1'/%3E%3Cpolygon points='30,20 70,20 80,50 70,80 30,80 20,50' fill='none' stroke='%23749cac' stroke-width='0.8'/%3E%3Ccircle cx='50' cy='50' r='15' fill='none' stroke='%2344487c' stroke-width='0.6'/%3E%3Cline x1='20' y1='20' x2='80' y2='80' stroke='%234484b0' stroke-width='0.4' opacity='0.5'/%3E%3Cline x1='80' y1='20' x2='20' y2='80' stroke='%234484b0' stroke-width='0.4' opacity='0.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 200px 200px;
  z-index: 1;
  opacity: 0.8;
}

/* Additional geometric overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.1'%3E%3Cpath d='M30,5 L55,30 L30,55 L5,30 Z' fill='none' stroke='%23749cac' stroke-width='1'/%3E%3Crect x='15' y='15' width='30' height='30' fill='none' stroke='%234484b0' stroke-width='0.8' opacity='0.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  background-position: 60px 60px;
  z-index: 2;
}

/* Login Wrapper */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
  position: relative;
  z-index: 10;
}

/* Login Card */
.login-card {
  background: #ffffff;
  border: 1px solid #dce4ec;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 360px;
  position: relative;
  animation: slideUpLogin 0.4s ease;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #182c44;
}

/* Shake Animation for Errors */
.login-card.shake {
  animation: shakeError 0.4s ease;
}

@keyframes slideUpLogin {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shakeError {
  0%, 20%, 40%, 60%, 80%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
}

/* Logo Section */
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo img {
  width: 160px;
  height: auto;
  transition: transform 0.2s ease;
}

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

/* Error Message */
.error-msg {
  background: #e53e3e;
  color: #ffffff;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slideInError 0.3s ease;
}

@keyframes slideInError {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Input Group */
.input-group {
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid #dce4ec;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #182c44;
}

.input-group input:focus {
  border-color: #4484b0;
  box-shadow: 0 0 0 2px rgba(68, 132, 176, 0.1);
}

.input-group input:hover:not(:focus) {
  border-color: #749cac;
}

.input-group input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Input Icons */
.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 12px;
  z-index: 2;
  transition: color 0.2s ease;
}

.input-group input:focus + .input-icon,
.input-group:has(input:focus) .input-icon {
  color: #4484b0;
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94a3b8;
  font-size: 12px;
  padding: 4px;
  transition: all 0.2s ease;
  z-index: 3;
}

.password-toggle:hover {
  color: #4484b0;
  background: rgba(68, 132, 176, 0.1);
}

/* Select Group */
.select-group {
  position: relative;
}

.select-group select {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid #dce4ec;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #182c44;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 12px;
  padding-right: 32px;
}

.select-group select:focus {
  border-color: #4484b0;
  box-shadow: 0 0 0 2px rgba(68, 132, 176, 0.1);
}

.select-group select:hover:not(:focus) {
  border-color: #749cac;
}

.select-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 12px;
  z-index: 2;
  transition: color 0.2s ease;
  pointer-events: none;
}

.select-group:has(select:focus) .select-icon {
  color: #4484b0;
}

/* Captcha Styles */
.captcha-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.captcha-image-container {
  position: relative;
  display: flex;
  justify-content: center;
  background: #f8fafc;
  padding: 8px;
  border: 1px solid #dce4ec;
}

.captcha-image {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.captcha-image:hover {
  transform: scale(1.02);
}

.captcha-refresh {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #4484b0;
  color: #ffffff;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.captcha-refresh:hover {
  background: #182c44;
  transform: rotate(90deg);
}

/* Login Button */
.login-btn {
  background: #4484b0;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.login-btn:hover {
  background: #182c44;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Security Notice */
.security-notice {
  background: rgba(214, 158, 46, 0.1);
  border: 1px solid rgba(214, 158, 46, 0.2);
  color: #d69e2e;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: center;
  animation: slideInWarning 0.3s ease;
}

@keyframes slideInWarning {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Login Footer */
.login-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #dce4ec;
}

.login-footer small {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 480px) {
  .login-wrapper {
    padding: 12px;
  }
  
  .login-card {
    padding: 20px;
    max-width: 320px;
  }
  
  .login-logo img {
    width: 140px;
  }
  
  .input-group input,
  .select-group select {
    padding: 8px 10px 8px 28px;
    font-size: 12px;
  }
  
  .login-btn {
    padding: 9px 14px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .login-card {
    padding: 16px;
  }
  
  .login-logo img {
    width: 120px;
  }
}

/* Focus visible for accessibility */
.login-btn:focus-visible,
.input-group input:focus-visible,
.select-group select:focus-visible {
  outline: 2px solid #4484b0;
  outline-offset: 1px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .login-card {
    border: 2px solid #182c44;
  }
  
  .input-group input,
  .select-group select {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .login-wrapper {
    background: #ffffff;
  }
  
  .login-card {
    box-shadow: none;
    border: 1px solid #182c44;
  }
}