/* ===========================
   LOGIN PAGE - MODERN UI/UX DESIGN
   =========================== */

* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-page {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #f8f9fb;
}

/* ===========================
   LEFT PANEL - WELCOME SECTION
   =========================== */

.login-left-panel {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
}

/* Animated gradient overlay */
.login-left-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Floating particles */
.login-left-panel::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  top: -250px;
  right: -250px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

.welcome-content {
  position: relative;
  z-index: 1;
  color: white;
  max-width: 520px;
  animation: fadeInLeft 0.8s ease-out;
}

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

.logo-section {
  margin-bottom: 48px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-icon .material-icons {
  font-size: 36px;
  color: white;
}

.logo-section h1 {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 12px 0;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.welcome-text {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 40px 0;
  font-weight: 400;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.95);
  animation: fadeInUp 0.6s ease-out backwards;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(8px);
  border-color: rgba(255, 255, 255, 0.25);
}

.feature-item:nth-child(1) { animation-delay: 0.2s; }
.feature-item:nth-child(2) { animation-delay: 0.3s; }
.feature-item:nth-child(3) { animation-delay: 0.4s; }
.feature-item:nth-child(4) { animation-delay: 0.5s; }

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

.feature-item .material-icons {
  font-size: 22px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px;
  border-radius: 8px;
}

/* ===========================
   RIGHT PANEL - LOGIN FORM
   =========================== */

.login-right-panel {
  flex: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  overflow-y: auto;
}

.login-container {
  width: 100%;
  max-width: 480px;
  animation: fadeInRight 0.8s ease-out;
}

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

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

.login-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
}

.login-header p {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
  font-weight: 400;
}

/* ===========================
   FORM STYLES
   =========================== */

form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Alert Messages */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideDown 0.4s ease;
  font-weight: 500;
}

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

.alert .material-icons {
  font-size: 20px;
  flex-shrink: 0;
}

.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-error .material-icons {
  color: #dc2626;
}

.alert-success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-success .material-icons {
  color: #16a34a;
}

/* Input Fields */
.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  letter-spacing: -0.1px;
}

.input-label .material-icons {
  font-size: 18px;
  color: #667eea;
}

.input-field {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  color: #111827;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.3s ease;
  outline: none;
}

.input-field::placeholder {
  color: #9ca3af;
}

.input-field:hover {
  border-color: #d1d5db;
  background: #ffffff;
}

.input-field:focus {
  border-color: #667eea;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-field:focus + .toggle-password {
  color: #667eea;
}

/* Password Input Group */
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-group .input-field {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #9ca3af;
}

.toggle-password:hover {
  background: #f3f4f6;
  color: #667eea;
}

.toggle-password:active {
  transform: scale(0.95);
}

.toggle-password .material-icons {
  font-size: 20px;
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -8px 0;
}

/* Custom Checkbox */
.remember-me {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.remember-me input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

.remember-me:hover .checkbox-custom {
  border-color: #667eea;
}

.remember-me input[type="checkbox"]:checked ~ .checkbox-custom {
  background: #667eea;
  border-color: #667eea;
}

.remember-me input[type="checkbox"]:checked ~ .checkbox-custom::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-label {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.link-forgot {
  font-size: 14px;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 6px;
}

.link-forgot:hover {
  color: #5568d3;
  background: #f3f4f6;
}

/* Buttons */
.btn-login {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
  transition: all 0.3s ease;
  margin-top: 8px;
  font-family: inherit;
}

.btn-login:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
  transform: translateY(-2px);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-login .material-icons {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.btn-login:hover .material-icons {
  transform: translateX(4px);
}

/* Form Divider */
.form-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 8px 0;
  position: relative;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.form-divider span {
  padding: 0 16px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  background: white;
  z-index: 1;
}

/* Secondary Button */
.btn-secondary {
  width: 100%;
  height: 48px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  color: #374151;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-secondary:hover {
  border-color: #667eea;
  color: #667eea;
  background: #f9fafb;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary .material-icons {
  font-size: 20px;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 1024px) {
  .login-left-panel,
  .login-right-panel {
    padding: 40px;
  }

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

  .welcome-text {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .login-page {
    flex-direction: column;
    overflow-y: auto;
  }

  .login-left-panel {
    flex: 0 0 auto;
    min-height: 35vh;
    padding: 32px 24px;
  }

  .welcome-content {
    max-width: 100%;
    text-align: center;
  }

  .logo-section {
    margin-bottom: 32px;
  }

  .logo-icon {
    margin: 0 auto 20px;
    width: 64px;
    height: 64px;
  }

  .logo-icon .material-icons {
    font-size: 32px;
  }

  .logo-section h1 {
    font-size: 28px;
  }

  .welcome-text {
    font-size: 15px;
    margin-bottom: 28px;
  }

  .features-list {
    display: none;
  }

  .login-right-panel {
    flex: 1;
    padding: 32px 24px;
    min-height: 65vh;
  }

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

  .login-header p {
    font-size: 14px;
  }

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

@media (max-width: 480px) {
  .login-left-panel {
    min-height: 30vh;
    padding: 24px 20px;
  }

  .logo-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .logo-icon .material-icons {
    font-size: 28px;
  }

  .logo-section h1 {
    font-size: 24px;
  }

  .welcome-text {
    font-size: 14px;
  }

  .login-right-panel {
    padding: 24px 20px;
  }

  .login-container {
    max-width: 100%;
  }

  .login-header {
    margin-bottom: 32px;
  }

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

  .input-field {
    height: 46px;
    font-size: 14px;
  }

  .btn-login {
    height: 48px;
    font-size: 15px;
  }

  .btn-secondary {
    height: 46px;
    font-size: 14px;
  }

  form {
    gap: 20px;
  }
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}
