/* =================================================================
   AUTHENTICATION STYLES - VELTECHLAB
   ================================================================= */

/* =================================================================
   AUTH CONTAINER
   ================================================================= */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e40af 100%);
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

.auth-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.auth-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="auth-pattern" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="0" cy="0" r="0.5" fill="rgba(59,130,246,0.1)"/><circle cx="40" cy="40" r="0.8" fill="rgba(139,92,246,0.08)"/></pattern></defs><rect width="100" height="100" fill="url(%23auth-pattern)"/></svg>');
  opacity: 0.6;
  animation: floatPattern 30s linear infinite;
}

@keyframes floatPattern {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-20px) translateX(10px); }
  100% { transform: translateY(0) translateX(0); }
}

.auth-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 450px;
}

/* =================================================================
   AUTH CARD
   ================================================================= */

.auth-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
  color: white;
  animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-header {
  margin-bottom: 2.5rem;
}

.auth-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.auth-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  font-size: 1.1rem;
  opacity: 0.8;
  margin: 0;
}

/* =================================================================
   BACK TO HOME LINK
   ================================================================= */

.back-home {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 10;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  transition: all 0.3s ease;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.back-link i {
  font-size: 1.1rem;
}

/* =================================================================
   FORM STYLES
   ================================================================= */

.auth-form {
  text-align: left;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: white;
  font-size: 0.95rem;
}

.form-label i {
  color: #3b82f6;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-input.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.form-input.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-error {
  display: none;
  color: #fca5a5;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 0.5rem;
  border-left: 3px solid #ef4444;
}

.form-error.show {
  display: block;
}

.form-success {
  display: none;
  color: #86efac;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 0.5rem;
  border-left: 3px solid #22c55e;
}

.form-success.show {
  display: block;
}

.form-warning {
  display: none;
  color: #fbbf24;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 0.5rem;
  border-left: 3px solid #f59e0b;
}

.form-warning.show {
  display: block;
}

.form-info {
  display: none;
  color: #60a5fa;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 0.5rem;
  border-left: 3px solid #3b82f6;
}

.form-info.show {
  display: block;
}

.form-valid {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.form-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.form-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.form-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.form-focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
}

.form-hover {
  border-color: #3b82f6;
  transition: border-color 0.15s ease-in-out;
}

.form-active {
  background-color: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.form-selected {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.form-checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.form-unchecked {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.2);
}

.form-required::after {
  content: '*';
  color: #ef4444;
  margin-left: 0.25rem;
}

.form-optional {
  opacity: 0.8;
}

/* =================================================================
   PASSWORD INPUT
   ================================================================= */

.password-input-wrapper {
  position: relative;
}

.password-input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.password-toggle:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.password-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* =================================================================
   PASSWORD STRENGTH
   ================================================================= */

.password-strength {
  margin-top: 0.75rem;
}

.strength-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.strength-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* =================================================================
   FORM OPTIONS
   ================================================================= */

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.form-checkbox {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.form-checkbox:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.form-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.checkbox-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.terms-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.terms-link:hover {
  text-decoration: underline;
}

.forgot-password {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* =================================================================
   BUTTONS
   ================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
}

.btn-warning {
  background: linear-gradient(45deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(45deg, #d97706, #92400e);
  border-color: #d97706;
  transform: translateY(-2px);
}

.btn-warning:active:not(:disabled) {
  background: #92400e;
  border-color: #92400e;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
}

.btn-text,
.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =================================================================
   SOCIAL AUTH
   ================================================================= */

.auth-divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.auth-divider span {
  background: rgba(15, 23, 42, 0.8);
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.social-auth {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-social {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-social:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-google:hover {
  border-color: #ea4335;
  box-shadow: 0 8px 25px rgba(234, 67, 53, 0.3);
}

.btn-facebook:hover {
  border-color: #1877f2;
  box-shadow: 0 8px 25px rgba(24, 119, 242, 0.3);
}

/* =================================================================
   AUTH FOOTER
   ================================================================= */

.auth-footer {
  text-align: center;
  margin-top: 2rem;
}

.auth-footer p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.auth-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* =================================================================
   MODAL STYLES
   ================================================================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-body {
  padding: 2rem;
}

.modal-body p {
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.forgot-password-form .form-group {
  margin-bottom: 1.5rem;
}

.forgot-password-form .form-label {
  color: #374151;
  margin-bottom: 0.5rem;
}

.forgot-password-form .form-input {
  background: white;
  border: 2px solid #e5e7eb;
  color: #1f2937;
}

.forgot-password-form .form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.forgot-password-form .btn-primary {
  width: 100%;
}

/* =================================================================
   TOAST NOTIFICATIONS
   ================================================================= */

.toast-container,
#toastContainer {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  pointer-events: none;
}

.notification {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-left: 4px solid;
  animation: toastSlideIn 0.3s ease-out;
  overflow: hidden;
  pointer-events: auto;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  position: relative;
}

.notification i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.notification span {
  flex: 1;
  color: #374151;
  font-weight: 500;
}

.notification-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background: #f3f4f6;
  color: #6b7280;
}

/* Notification Types */
.notification-success {
  border-left-color: #10b981;
}

.notification-success i {
  color: #10b981;
}

.notification-error {
  border-left-color: #ef4444;
}

.notification-error i {
  color: #ef4444;
}

.notification-warning {
  border-left-color: #f59e0b;
}

.notification-warning i {
  color: #f59e0b;
}

.notification-info {
  border-left-color: #3b82f6;
}

.notification-info i {
  color: #3b82f6;
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (max-width: 768px) {
  .auth-container {
    padding: 1rem;
  }
  
  .auth-card {
    padding: 2rem 1.5rem;
  }
  
  .auth-title {
    font-size: 1.75rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .back-home {
    top: 1rem;
    left: 1rem;
  }
  
  .back-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .back-link span {
    display: none;
  }
  
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
  
  .modal {
    padding: 0.5rem;
  }
  
  .modal-content {
    margin: 0;
  }
  
  .modal-header,
  .modal-body {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1rem;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
  
  .auth-subtitle {
    font-size: 1rem;
  }
  
  .form-input {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
  
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .social-auth {
    gap: 0.75rem;
  }
  
  .btn-social {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* =================================================================
   ACCESSIBILITY
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .btn,
  .form-input,
  .modal-content,
  .notification {
    animation: none;
    transition: none;
  }
  
  .btn:hover {
    transform: none;
  }
}

@media (prefers-contrast: high) {
  .auth-card {
    border: 2px solid white;
  }
  
  .form-input {
    border-width: 3px;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* =================================================================
   PRINT STYLES
   ================================================================= */

@media print {
  .back-home,
  .social-auth,
  .modal,
  .toast-container {
    display: none !important;
  }
  
  .auth-card {
    background: white;
    color: black;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .form-input {
    background: white;
    color: black;
    border: 1px solid #ccc;
  }
}

/* =================================================================
   ADMIN DASHBOARD BUTTON
   ================================================================= */

.admin-dashboard-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: linear-gradient(45deg, #f59e0b, #d97706);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.admin-dashboard-btn:hover {
  background: linear-gradient(45deg, #d97706, #92400e);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
  text-decoration: none;
  color: white;
}

.admin-dashboard-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.admin-dashboard-btn i {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .admin-dashboard-btn {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
  }
}
