/* CarBazaar Auth Pages - Modern Mobile-First Design */
/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  background: #f8f9fa;
  color: #212529;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Auth layout */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: calc(100vh - 120px);
}

/* Auth card */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 32px 24px;
  margin: 0 auto;
}

/* Logo and header */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  font-size: 28px;
  font-weight: 700;
  color: #4CAF50;
  margin-bottom: 8px;
  text-decoration: none;
}

.auth-tagline {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 0;
}

/* Form styles */
.auth-form {
  margin-bottom: 24px;
}

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

.form-input {
  width: 100%;
  min-height: 50px;
  padding: 16px 16px 8px 16px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-input:not(:placeholder-shown) {
  padding-top: 20px;
  padding-bottom: 12px;
}

.form-input.error {
  border-color: #dc3545;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Floating labels */
.form-label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 14px;
  color: #666;
  pointer-events: none;
  transition: all 0.2s ease;
  background: white;
  padding: 0 4px;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: -8px;
  left: 12px;
  font-size: 12px;
  color: #4CAF50;
  font-weight: 500;
}

/* Password toggle */
.password-group {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 18px;
  padding: 4px;
}

.password-toggle:hover {
  color: #4CAF50;
}

/* Password strength indicator */
.password-strength {
  margin-top: 8px;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-weak { background: #dc3545; width: 33%; }
.strength-medium { background: #ffc107; width: 66%; }
.strength-strong { background: #4CAF50; width: 100%; }

.strength-text {
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

/* Checkbox styles */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.form-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #4CAF50;
  margin-top: 2px;
  flex-shrink: 0;
}

.checkbox-label {
  font-size: 14px;
  color: #495057;
  line-height: 1.4;
}

.checkbox-label a {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 500;
}

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

/* Button styles */
.btn-primary {
  width: 100%;
  min-height: 50px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Links */
.auth-links {
  text-align: center;
  margin-bottom: 24px;
}

.auth-links a {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover {
  text-decoration: underline;
}

.forgot-password {
  font-size: 14px;
  margin-bottom: 16px;
}

.switch-auth {
  font-size: 14px;
}

.switch-auth .secondary-link {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
  display: block;
}

/* Error and success messages */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.field-error {
  font-size: 12px;
  color: #dc3545;
  margin-top: 4px;
  margin-left: 4px;
}

/* Trust elements */
.trust-elements {
  text-align: center;
  margin: 24px 0;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.trust-icon {
  font-size: 20px;
  color: #4CAF50;
  margin-bottom: 8px;
}

.trust-text {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* File upload for dealer */
.file-upload {
  position: relative;
  border: 2px dashed #e9ecef;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 20px;
}

.file-upload:hover,
.file-upload.dragover {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.02);
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.upload-text {
  color: #666;
  font-size: 14px;
}

.upload-preview {
  margin-top: 12px;
  max-width: 100px;
  max-height: 100px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

/* Footer */
.auth-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: #666;
  background: white;
  border-top: 1px solid #e9ecef;
  margin-top: auto;
}

.auth-footer a {
  color: #4CAF50;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Responsive design */
@media (min-width: 640px) {
  .auth-container {
    padding: 40px;
  }
  
  .auth-card {
    padding: 40px;
  }
  
  .auth-title {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 16px;
    min-height: calc(100vh - 100px);
  }
  
  .auth-card {
    padding: 24px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  }
  
  .auth-logo {
    font-size: 24px;
  }
  
  .auth-title {
    font-size: 22px;
  }
}

/* Focus styles for accessibility */
.form-input:focus,
.btn-primary:focus,
.form-checkbox:focus,
.password-toggle:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

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

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Ireland-specific styling */
.ireland-flag {
  display: inline-block;
  margin-right: 4px;
}

.phone-hint {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  margin-left: 4px;
}

/* Form validation states */
.form-input.valid {
  border-color: #28a745;
}

.form-input.valid + .form-label {
  color: #28a745;
}

/* Social auth buttons (for future) */
.social-auth {
  margin-bottom: 24px;
}

.btn-google,
.btn-apple {
  width: 100%;
  min-height: 50px;
  border: 2px solid #e9ecef;
  background: white;
  color: #495057;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-google:hover,
.btn-apple:hover {
  border-color: #4CAF50;
  background: #f8f9fa;
}

.divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
  color: #666;
  font-size: 14px;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e9ecef;
  z-index: 1;
}

.divider span {
  background: white;
  padding: 0 16px;
  position: relative;
  z-index: 2;
}