/* ===== VARIABLES ===== */
:root {
  --bg-color: #0f0f0f;
  --card-bg: rgba(255, 255, 255, 0.1);
  --primary-color: #1c1d1c;
  --input-bg: rgba(255, 255, 255, 0.15);
  --text-color: #ffffff;
  --placeholder-color: #c0c0c0;
  --button-hover: #1ed760;
  --link-color: #1c1d1c;
  --border-color: rgba(255, 255, 255, 0.2);
  --error-color: #dc3545;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
}

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

body {
  background: var(--bg-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  overflow: hidden;
  position: relative;
  line-height: 1.6;
}

/* ===== PARTICLES BACKGROUND ===== */
#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
  top: 0;
  left: 0;
}

/* ===== MAIN CONTAINER ===== */
#login-section {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 1rem;
}

#login-container {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  animation: slideIn 1s ease-out forwards, float 6s ease-in-out infinite;
  width: 100%;
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* ===== HEADER ===== */
header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

h1 {
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 0.5rem;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 2rem;
  position: relative;
}

h1::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--text-color);
  opacity: 0.8;
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

.subtitle {
  color: var(--text-color);
  opacity: 0.8;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== FORM ===== */
form {
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.form-label {
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label i {
  font-size: 0.9rem;
  opacity: 0.8;
}

.form-control {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

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

.form-control:focus {
  outline: none;
  border: 1px solid var(--primary-color);
  box-shadow: 0 0 8px rgba(28, 29, 28, 0.3);
  background: var(--input-bg);
  transform: translateY(-1px);
}

.form-control.is-invalid {
  border-color: var(--error-color);
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.3);
}

.form-control.is-valid {
  border-color: var(--success-color);
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

.invalid-feedback {
  display: block;
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  animation: fadeIn 0.3s ease-out;
}

/* ===== INPUT GROUP ===== */
.input-group {
  position: relative;
}

.input-group .form-control {
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .btn {
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: var(--input-bg);
  border-color: var(--border-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.input-group .btn:hover {
  background: var(--border-color);
  color: var(--text-color);
}

/* ===== BUTTONS ===== */
.btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--primary-color);
  border: none;
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 1rem;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-outline-light {
  border: 1px solid var(--border-color);
  color: var(--text-color);
  background: transparent;
  margin-top: 1rem;
}

.btn-outline-light:hover:not(:disabled) {
  background: var(--border-color);
  color: var(--text-color);
  transform: translateY(-1px);
}

.btn-outline-light:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ===== DIVIDER ===== */
.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
  animation: fadeIn 0.8s ease-out 0.6s both;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  background: var(--card-bg);
  padding: 0 1rem;
  color: var(--placeholder-color);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* ===== FOOTER ===== */
footer {
  animation: fadeIn 0.8s ease-out 0.8s both;
}

a {
  color: var(--text-color);
  opacity: 0.8;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

a:hover {
  color: var(--text-color);
  opacity: 1;
  text-decoration: underline;
  transform: translateY(-1px);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  z-index: 9999;
}

.toast {
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
}

/* ===== LOADING STATES ===== */
.btn-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 576px) {
  #login-container {
    padding: 2rem;
    margin: 1rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  .btn {
    font-size: 0.95rem;
  }
  
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  #login-container {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .subtitle {
    font-size: 0.8rem;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FOCUS VISIBILITY ===== */
.btn:focus,
.form-control:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  :root {
    --border-color: #ffffff;
    --text-color: #ffffff;
    --placeholder-color: #cccccc;
  }
  
  .form-control {
    border-width: 2px;
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #000000;
    --card-bg: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(255, 255, 255, 0.1);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  #particles-js,
  .btn,
  .toast-container {
    display: none !important;
  }
  
  #login-container {
    box-shadow: none;
    border: 1px solid #000;
    background: white;
    color: black;
  }
} 