/* Pigskin Classic Authentication Styles */

/* CSS Variables for consistent theming */
:root {
  --primary-green: #2d5a2d;
  --secondary-green: #4a7c59;
  --accent-gold: #c9a961;
  --light-green: #e8f5e8;
  --dark-green: #1a3d1a;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --dark-gray: #343a40;
  --error-red: #dc3545;
  --success-green: #28a745;
  --warning-orange: #fd7e14;
  --info-blue: #17a2b8;
  --border-color: #dee2e6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-gray);
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
  min-height: 100vh;
  position: relative;
}

/* Football field background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.03) 48px,
      rgba(255, 255, 255, 0.03) 52px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.02) 48px,
      rgba(255, 255, 255, 0.02) 50px
    );
  z-index: -1;
}

/* Container and layout */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 450px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-green), var(--accent-gold), var(--secondary-green));
}

/* Header styles */
.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  display: inline-block;
  margin-bottom: 20px;
}

.logo-text {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary-green);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0;
  letter-spacing: -1px;
}

.logo-subtitle {
  font-size: 0.9rem;
  color: var(--medium-gray);
  font-weight: 500;
  margin-top: 5px;
}

.auth-title {
  font-size: 1.8rem;
  color: var(--dark-gray);
  margin-bottom: 10px;
  font-weight: 600;
}

.auth-subtitle {
  color: var(--medium-gray);
  font-size: 0.95rem;
}

/* Form styles */
.auth-form {
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--dark-gray);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(45, 90, 45, 0.1);
}

.form-control.error {
  border-color: var(--error-red);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.success {
  border-color: var(--success-green);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Password input with toggle */
.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--medium-gray);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--primary-green);
  background-color: var(--light-green);
}

/* Validation icons */
.validation-icon {
  position: absolute;
  right: 45px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  pointer-events: none;
}

.validation-icon.success {
  color: var(--success-green);
}

.validation-icon.error {
  color: var(--error-red);
}

/* Password strength indicator */
.password-strength {
  margin-top: 8px;
}

.strength-bar {
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.strength-progress {
  height: 100%;
  transition: var(--transition);
  border-radius: 3px;
}

.strength-progress.weak {
  width: 25%;
  background-color: var(--error-red);
}

.strength-progress.fair {
  width: 50%;
  background-color: var(--warning-orange);
}

.strength-progress.good {
  width: 75%;
  background-color: var(--info-blue);
}

.strength-progress.strong {
  width: 100%;
  background-color: var(--success-green);
}

.strength-requirements {
  font-size: 0.8rem;
  color: var(--medium-gray);
}

.requirement {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  transition: var(--transition);
}

.requirement.met {
  color: var(--success-green);
}

.requirement-icon {
  margin-right: 8px;
  font-size: 0.9rem;
}

/* Checkbox and form controls */
.form-check {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.form-check-input {
  margin-right: 12px;
  margin-top: 2px;
  transform: scale(1.2);
  accent-color: var(--primary-green);
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--medium-gray);
  line-height: 1.4;
  cursor: pointer;
}

.form-check-label a {
  color: var(--primary-green);
  text-decoration: none;
}

.form-check-label a:hover {
  text-decoration: underline;
}

/* Select dropdown */
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background-color: var(--white);
  cursor: pointer;
  transition: var(--transition);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(45, 90, 45, 0.1);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
  color: var(--white);
  width: 100%;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(45, 90, 45, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(45, 90, 45, 0.3);
}

.btn-secondary {
  background-color: var(--light-gray);
  color: var(--dark-gray);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--white);
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.btn-link {
  background: none;
  color: var(--primary-green);
  text-decoration: none;
  padding: 8px 0;
  border: none;
  font-weight: 500;
}

.btn-link:hover {
  text-decoration: underline;
  color: var(--secondary-green);
}

/* Loading state */
.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  color: var(--white);
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Alert messages */
.alert {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  animation: slideIn 0.3s ease-out;
}

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

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.2);
  color: var(--success-green);
}

.alert-error {
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: var(--error-red);
}

.alert-warning {
  background-color: rgba(253, 126, 20, 0.1);
  border: 1px solid rgba(253, 126, 20, 0.2);
  color: var(--warning-orange);
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.1);
  border: 1px solid rgba(23, 162, 184, 0.2);
  color: var(--info-blue);
}

.alert-icon {
  margin-right: 8px;
  font-size: 1.1rem;
}

/* Error messages */
.error-message {
  color: var(--error-red);
  font-size: 0.85rem;
  margin-top: 5px;
  display: flex;
  align-items: center;
}

.error-message .error-icon {
  margin-right: 6px;
}

/* Links and navigation */
.auth-links {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.auth-links p {
  margin-bottom: 10px;
  color: var(--medium-gray);
  font-size: 0.9rem;
}

.auth-links a {
  color: var(--primary-green);
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover {
  text-decoration: underline;
  color: var(--secondary-green);
}

/* Demo accounts section */
.demo-accounts {
  background: var(--light-green);
  border: 1px solid rgba(45, 90, 45, 0.1);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 20px;
}

.demo-accounts h4 {
  color: var(--primary-green);
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.demo-account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(45, 90, 45, 0.1);
  font-size: 0.85rem;
}

.demo-account:last-child {
  border-bottom: none;
}

.demo-username {
  font-weight: 500;
  color: var(--dark-gray);
}

.demo-password {
  font-family: 'Courier New', monospace;
  color: var(--medium-gray);
}

.demo-use-btn {
  background: var(--primary-green);
  color: var(--white);
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}

.demo-use-btn:hover {
  background: var(--secondary-green);
}

/* Responsive design */
@media (max-width: 768px) {
  .auth-container {
    padding: 10px;
  }
  
  .auth-card {
    padding: 30px 20px;
    margin: 10px;
  }
  
  .logo-text {
    font-size: 2rem;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
  
  .form-control,
  .form-select,
  .btn {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  .demo-account {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .demo-use-btn {
    align-self: flex-end;
  }
}

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

@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
  
  .form-control:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
  }
}

/* Print styles */
@media print {
  body {
    background: var(--white);
  }
  
  .auth-card {
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
  
  .btn {
    display: none;
  }
}