/**
 * Authentication Pages Styles - Smooth White Professional Theme
 * Mobile Phone Sales & Repair Management System
 * Uses CSS variables from global.css for consistent theming
 */

/* ================================
   Page Layout - Using Global CSS Variables
   ================================ */
.auth-page {
  min-height: 100vh;
  background: var(--body-bg);
  background-image: linear-gradient(
    135deg,
    var(--light-color) 0%,
    var(--lighter-color) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.auth-container {
  width: 100%;
  max-width: 450px;
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-heavy);
  padding: 3rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.auth-card:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--stats-primary);
}

/* ================================
   Header - Using Global CSS Variables
   ================================ */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-flex;
  width: 80px;
  height: 80px;
  background: var(--stats-primary);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-medium);
  transition: var(--transition);
}

.auth-logo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-heavy);
}

.auth-logo i {
  font-size: 2.5rem;
  color: #ffffff;
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  font-weight: 500;
}

/* ================================
   Form Styling - Using Global CSS Variables
   ================================ */
.auth-form {
  margin-bottom: 1.5rem;
}

.form-floating {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-floating > .form-control {
  height: 3.5rem;
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  padding: 1rem;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-floating > .form-control[type="password"] {
  padding-right: 3.5rem;
}

.form-floating > .form-control:focus {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow);
  background: var(--input-bg);
  color: var(--text-primary);
}

.form-floating > label {
  padding: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
  color: var(--primary-color);
  font-weight: 600;
}

/* ================================
   Password Toggle - Using Global CSS Variables
   ================================ */
.form-floating {
  position: relative;
}

.form-floating .password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 1.75rem;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  z-index: 10;
  transition: var(--transition);
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

.form-floating .password-toggle:hover {
  color: var(--primary-color);
  background: var(--icon-primary-bg);
}

.form-floating .password-toggle:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ================================
   Form Validation - Using Global CSS Variables
   ================================ */
.was-validated .form-control:valid {
  border-color: var(--success-color);
}

.was-validated .form-control:invalid {
  border-color: var(--danger-color);
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--danger-color);
  font-weight: 500;
}

/* ================================
   Checkbox Styling - Using Global CSS Variables
   ================================ */
.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
}

.form-check-input:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  background-image: none;
}

.form-check-input:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.form-check-input:focus {
  box-shadow: var(--input-focus-shadow) !important;
  border-color: var(--primary-color) !important;
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
}

/* ================================
   Button Styling - Using Global CSS Variables
   ================================ */
.btn-primary {
  background: var(--btn-primary-bg);
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  color: white;
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--secondary-color);
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-primary:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ================================
   Alert Styling - Using Global CSS Variables
   ================================ */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.alert-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background: rgba(8, 145, 178, 0.1);
  color: var(--info-color);
  border-left: 4px solid var(--info-color);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert i {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

/* ================================
   Footer - Using Global CSS Variables
   ================================ */
.auth-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1.5rem;
}

.auth-footer p {
  margin: 0.25rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================================
   Loading Animation - Using Global CSS Variables
   ================================ */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* ================================
   Enhanced Responsive Design
   ================================ */
@media (max-width: 576px) {
  .auth-page {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    margin: 0.5rem;
  }

  .auth-logo {
    width: 60px;
    height: 60px;
  }

  .auth-logo i {
    font-size: 2rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .auth-subtitle {
    font-size: 0.9rem;
  }

  .form-floating > .form-control {
    height: 3rem;
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1rem;
  }

  .auth-title {
    font-size: 1.375rem;
  }

  .form-floating > .form-control {
    height: 2.75rem;
    padding: 0.75rem;
  }

  .form-floating > label {
    padding: 0.75rem;
  }
}

/* ================================
   Consistent Theme Support
   ================================ */
body.auth-page {
  background-color: var(--body-bg);
  color: var(--text-primary);
}

/* ================================
   Animation for page load
   ================================ */
.auth-card {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   Focus styles for accessibility
   ================================ */
.btn-primary:focus,
.form-control:focus,
.form-check-input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ================================
   Print styles
   ================================ */
@media print {
  .auth-page {
    background: none;
  }

  .auth-card {
    box-shadow: none;
    border: 1px solid var(--border-color);
  }

  .auth-card::before {
    display: none;
  }
}

/* ================================
   Enhanced Interactive Elements
   ================================ */
.auth-card .form-control:hover {
  border-color: var(--primary-color);
}

.auth-card .form-check-input:hover {
  border-color: var(--primary-color);
}

.auth-card .form-check-label:hover {
  color: var(--text-primary);
}

/* ================================
   Loading States
   ================================ */
.btn-primary .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* ================================
   Debug Mode Styling
   ================================ */
.alert-info h6 {
  color: var(--info-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.alert-info strong {
  color: var(--text-primary);
}

.alert-info .text-muted {
  color: var(--text-muted) !important;
  font-size: 0.8rem;
}
