/*
 * Authentication Dark Theme CSS
 * Psycounts - Modern Dark Authentication Interface
 * Professional dark theme with green accent colors
 */

/* ===== CSS Custom Properties (Variables) ===== */
:root {
  /* Dark Theme Color Palette */
  --auth-bg-primary: #0a0e27;           /* Deep navy background */
  --auth-bg-secondary: #1a1f3a;         /* Lighter navy for containers */
  --auth-bg-tertiary: #2a2f4a;          /* Even lighter for hover states */

  /* Form Container Colors */
  --auth-form-bg: rgba(255, 255, 255, 0.1);     /* Semi-transparent white */
  --auth-form-bg-hover: rgba(255, 255, 255, 0.15); /* Hover state */
  --auth-form-border: rgba(255, 255, 255, 0.2);    /* Subtle borders */

  /* Typography Colors */
  --auth-text-primary: #ffffff;         /* Primary white text */
  --auth-text-secondary: #b8bcc8;       /* Secondary light gray */
  --auth-text-muted: #8b92a5;           /* Muted text */
  --auth-text-placeholder: #6b7280;     /* Placeholder text */

  /* Accent Colors */
  --auth-accent-primary: #22c55e;       /* Green accent */
  --auth-accent-hover: #16a34a;         /* Darker green for hover */
  --auth-success: #00d924;              /* Success green */
  --auth-error: #ff5b5b;                /* Error red */
  --auth-warning: #fbbf24;              /* Warning yellow */

  /* Spacing and Layout */
  --auth-container-padding: 2rem;
  --auth-form-padding: 2.5rem;
  --auth-border-radius: 12px;
  --auth-border-radius-small: 8px;

  /* Animation Properties */
  --auth-transition-fast: 0.15s ease-out;
  --auth-transition-normal: 0.3s ease-out;
  --auth-transition-slow: 0.5s ease-out;

  /* Shadows */
  --auth-shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
  --auth-shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
  --auth-shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.25);

  /* Backdrop Filter Support */
  --auth-backdrop-blur: blur(20px);
  --auth-backdrop-saturate: saturate(180%);
}

/* ===== Base Dark Theme Styles ===== */

/* Apply dark theme to authentication pages */
.auth-dark-theme {
  background: var(--auth-bg-primary);
  color: var(--auth-text-primary);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Main container for authentication content */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--auth-container-padding);
  padding-bottom: 6rem; /* Extra space for copyright footer */
  position: relative;
  overflow: hidden;
}

/* ===== Transparent Form Container System ===== */

/* Main form container with advanced transparency */
.auth-form-container {
  background: var(--auth-form-bg);
  backdrop-filter: var(--auth-backdrop-blur) var(--auth-backdrop-saturate);
  -webkit-backdrop-filter: var(--auth-backdrop-blur) var(--auth-backdrop-saturate);
  border: 1px solid var(--auth-form-border);
  border-radius: var(--auth-border-radius);
  padding: var(--auth-form-padding);
  box-shadow: var(--auth-shadow-medium);
  transition: all var(--auth-transition-normal);
  position: relative;
  z-index: 10;
  max-width: 420px;
  width: 100%;
  overflow: hidden;
}

/* Enhanced hover effect for form container */
.auth-form-container:hover {
  background: var(--auth-form-bg-hover);
  box-shadow: var(--auth-shadow-heavy);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Focus-within effect when any form element is focused */
.auth-form-container:focus-within {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--auth-accent-primary);
  box-shadow:
    var(--auth-shadow-heavy),
    0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Inner container for additional layering */
.auth-form-inner {
  position: relative;
  z-index: 2;
}

/* Subtle background pattern overlay for texture */
.auth-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* Animated border glow effect */
.auth-form-container::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg,
    transparent,
    rgba(34, 197, 94, 0.1),
    transparent,
    rgba(34, 197, 94, 0.1),
    transparent
  );
  background-size: 400% 400%;
  border-radius: var(--auth-border-radius);
  opacity: 0;
  transition: opacity var(--auth-transition-normal);
  z-index: -1;
  animation: borderGlow 8s ease-in-out infinite;
}

.auth-form-container:hover::after {
  opacity: 0.3;
}

@keyframes borderGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(20px)) {
  .auth-form-container {
    background: var(--auth-bg-secondary);
    border: 1px solid var(--auth-form-border);
  }

  .auth-form-container:hover {
    background: var(--auth-bg-tertiary);
  }

  .auth-form-container:focus-within {
    background: var(--auth-bg-tertiary);
  }
}

/* Enhanced transparency for high-end browsers */
@supports (backdrop-filter: blur(20px)) and (background: paint(worklet)) {
  .auth-form-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px) saturate(200%) brightness(1.1);
  }
}

/* ===== Typography Styles ===== */

.auth-dark-theme h1,
.auth-dark-theme h2,
.auth-dark-theme h3,
.auth-dark-theme h4,
.auth-dark-theme h5,
.auth-dark-theme h6 {
  color: var(--auth-text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.auth-dark-theme .auth-title {
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--auth-text-primary);
}

.auth-dark-theme .auth-subtitle {
  font-size: 1rem;
  color: var(--auth-text-secondary);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.auth-dark-theme p {
  color: var(--auth-text-secondary);
  line-height: 1.6;
}

.auth-dark-theme a {
  color: var(--auth-accent-primary);
  text-decoration: none;
  transition: color var(--auth-transition-fast);
}

.auth-dark-theme a:hover {
  color: var(--auth-accent-hover);
  text-decoration: underline;
}

/* ===== Enhanced Form Styles for Transparent Containers ===== */

.auth-dark-theme .form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.auth-dark-theme label {
  color: var(--auth-text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--auth-transition-fast);
}

/* Enhanced form controls with better transparency integration */
.auth-dark-theme .form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--auth-form-border);
  border-radius: var(--auth-border-radius-small);
  color: var(--auth-text-primary);
  padding: 0.875rem 1rem;
  font-size: 1rem;
  transition: all var(--auth-transition-fast);
  position: relative;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Hover state for form controls */
.auth-dark-theme .form-control:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Enhanced focus state */
.auth-dark-theme .form-control:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--auth-accent-primary);
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.15);
  outline: none;
  transform: translateY(-2px);
}

/* Placeholder styling */
.auth-dark-theme .form-control::placeholder {
  color: var(--auth-text-placeholder);
  opacity: 0.7;
  transition: opacity var(--auth-transition-fast);
}

.auth-dark-theme .form-control:focus::placeholder {
  opacity: 0.5;
}

/* Floating label effect */
.auth-dark-theme .form-group.floating-label {
  position: relative;
}

.auth-dark-theme .form-group.floating-label label {
  position: absolute;
  top: 0.875rem;
  left: 1rem;
  background: transparent;
  padding: 0 0.25rem;
  transition: all var(--auth-transition-fast);
  pointer-events: none;
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--auth-text-placeholder);
}

.auth-dark-theme .form-group.floating-label .form-control:focus + label,
.auth-dark-theme .form-group.floating-label .form-control:not(:placeholder-shown) + label {
  top: -0.5rem;
  left: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--auth-accent-primary);
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(10px);
}

/* Input group styling for better integration */
.auth-dark-theme .input-group {
  position: relative;
}

.auth-dark-theme .input-group .form-control {
  border-right: none;
}

.auth-dark-theme .input-group-append .input-group-text {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--auth-form-border);
  border-left: none;
  color: var(--auth-text-secondary);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Select dropdown styling */
.auth-dark-theme select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23b8bcc8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Checkbox and radio styling */
.auth-dark-theme .form-check {
  margin-bottom: 1rem;
}

.auth-dark-theme .form-check-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--auth-form-border);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.auth-dark-theme .form-check-input:checked {
  background-color: var(--auth-accent-primary);
  border-color: var(--auth-accent-primary);
}

.auth-dark-theme .form-check-label {
  color: var(--auth-text-secondary);
  font-weight: 400;
  margin-left: 0.5rem;
}

/* ===== Enhanced Button Styles for Transparent Containers ===== */

.auth-dark-theme .btn-primary {
  background: linear-gradient(135deg, var(--auth-accent-primary) 0%, var(--auth-accent-hover) 100%);
  border: none;
  border-radius: var(--auth-border-radius-small);
  color: white;
  font-weight: 600;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  transition: all var(--auth-transition-fast);
  width: 100%;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

/* Button hover effect with enhanced transparency */
.auth-dark-theme .btn-primary:hover {
  background: linear-gradient(135deg, var(--auth-accent-hover) 0%, #15803d 100%);
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(34, 197, 94, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.auth-dark-theme .btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

/* Button loading state */
.auth-dark-theme .btn-primary:disabled,
.auth-dark-theme .btn-primary.loading {
  background: rgba(34, 197, 94, 0.5);
  cursor: not-allowed;
  transform: none;
}

/* Secondary button with enhanced transparency */
.auth-dark-theme .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--auth-form-border);
  border-radius: var(--auth-border-radius-small);
  color: var(--auth-text-primary);
  font-weight: 500;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  transition: all var(--auth-transition-fast);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.auth-dark-theme .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--auth-accent-primary);
  color: var(--auth-text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-dark-theme .btn-secondary:active {
  transform: translateY(0);
}

/* Outline button variant */
.auth-dark-theme .btn-outline-primary {
  background: transparent;
  border: 2px solid var(--auth-accent-primary);
  border-radius: var(--auth-border-radius-small);
  color: var(--auth-accent-primary);
  font-weight: 600;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  transition: all var(--auth-transition-fast);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-dark-theme .btn-outline-primary:hover {
  background: var(--auth-accent-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

/* Link button styling */
.auth-dark-theme .btn-link {
  color: var(--auth-accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--auth-transition-fast);
  background: transparent;
  border: none;
  padding: 0.5rem 0;
}

.auth-dark-theme .btn-link:hover {
  color: var(--auth-accent-hover);
  text-decoration: underline;
  background: transparent;
}

/* Button group styling */
.auth-dark-theme .btn-group .btn {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-dark-theme .btn-group .btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Enhanced Alert and Message Styles for Transparent Containers ===== */

.auth-dark-theme .alert {
  border-radius: var(--auth-border-radius-small);
  border: none;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.auth-dark-theme .alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: currentColor;
}

.auth-dark-theme .alert-success {
  background: rgba(0, 217, 36, 0.1);
  color: var(--auth-success);
  border: 1px solid rgba(0, 217, 36, 0.2);
}

.auth-dark-theme .alert-danger {
  background: rgba(255, 91, 91, 0.1);
  color: var(--auth-error);
  border: 1px solid rgba(255, 91, 91, 0.2);
}

.auth-dark-theme .alert-warning {
  background: rgba(251, 191, 36, 0.1);
  color: var(--auth-warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.auth-dark-theme .alert-info {
  background: rgba(34, 197, 94, 0.1);
  color: var(--auth-accent-primary);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Enhanced form validation styles */
.auth-dark-theme .is-invalid {
  border-color: var(--auth-error);
  background: rgba(255, 91, 91, 0.05);
  animation: shake 0.5s ease-in-out;
}

.auth-dark-theme .is-valid {
  border-color: var(--auth-success);
  background: rgba(0, 217, 36, 0.05);
}

.auth-dark-theme .invalid-feedback {
  color: var(--auth-error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
  background: rgba(255, 91, 91, 0.1);
  padding: 0.5rem;
  border-radius: var(--auth-border-radius-small);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.auth-dark-theme .valid-feedback {
  color: var(--auth-success);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
  background: rgba(0, 217, 36, 0.1);
  padding: 0.5rem;
  border-radius: var(--auth-border-radius-small);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* ===== Form Container States ===== */

/* Loading state for form container */
.auth-form-container.loading {
  pointer-events: none;
  opacity: 0.8;
}

.auth-form-container.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
}

.auth-form-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 3px solid transparent;
  border-top: 3px solid var(--auth-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 101;
}

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

/* Success state for form container */
.auth-form-container.success {
  border-color: var(--auth-success);
  background: rgba(0, 217, 36, 0.05);
}

/* Error state for form container */
.auth-form-container.error {
  border-color: var(--auth-error);
  background: rgba(255, 91, 91, 0.05);
  animation: shake 0.5s ease-in-out;
}

/* ===== Logo and Branding ===== */

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo img {
  max-height: 60px;
  width: auto;
  /* Keep original logo colors for brand consistency */
}

/* ===== Enhanced Responsive Design System ===== */

/* Base responsive variables */
:root {
  /* Touch target sizes for mobile */
  --auth-touch-target-min: 44px;
  --auth-touch-target-comfortable: 48px;

  /* Responsive spacing scale */
  --auth-spacing-xs: 0.25rem;
  --auth-spacing-sm: 0.5rem;
  --auth-spacing-md: 1rem;
  --auth-spacing-lg: 1.5rem;
  --auth-spacing-xl: 2rem;
  --auth-spacing-xxl: 3rem;

  /* Responsive font scale */
  --auth-font-xs: 0.75rem;
  --auth-font-sm: 0.875rem;
  --auth-font-base: 1rem;
  --auth-font-lg: 1.125rem;
  --auth-font-xl: 1.25rem;
  --auth-font-2xl: 1.5rem;
  --auth-font-3xl: 1.875rem;
  --auth-font-4xl: 2.25rem;
}

/* ===== Mobile-First Responsive Design (320px and up) ===== */

/* Extra small devices (320px - 479px) - Small phones */
@media (max-width: 479.98px) {
  :root {
    --auth-container-padding: 0.75rem;
    --auth-form-padding: 1.25rem;
    --auth-border-radius: 8px;
    --auth-border-radius-small: 6px;
  }

  .auth-container {
    padding: var(--auth-container-padding);
    align-items: flex-start;
    padding-top: 2rem;
  }

  .auth-form-container {
    margin: 0;
    max-width: none;
    width: 100%;
    min-height: auto;
    border-radius: var(--auth-border-radius);
  }

  .auth-form-container.wide {
    padding: var(--auth-form-padding);
  }

  .auth-dark-theme .auth-title {
    font-size: var(--auth-font-2xl);
    margin-bottom: var(--auth-spacing-lg);
    line-height: 1.2;
  }

  .auth-dark-theme .auth-subtitle {
    font-size: var(--auth-font-sm);
    margin-bottom: var(--auth-spacing-lg);
    line-height: 1.4;
  }

  /* Enhanced touch targets for mobile */
  .auth-dark-theme .btn-primary,
  .auth-dark-theme .btn-secondary,
  .auth-dark-theme .btn-outline-primary {
    padding: var(--auth-spacing-lg) var(--auth-spacing-xl);
    font-size: var(--auth-font-base);
    min-height: var(--auth-touch-target-comfortable);
    border-radius: var(--auth-border-radius-small);
  }

  .auth-dark-theme .form-control {
    padding: var(--auth-spacing-lg) var(--auth-spacing-md);
    font-size: var(--auth-font-base);
    min-height: var(--auth-touch-target-comfortable);
    border-radius: var(--auth-border-radius-small);
  }

  /* Mobile-optimized form groups */
  .auth-dark-theme .form-group {
    margin-bottom: var(--auth-spacing-lg);
  }

  /* Mobile-specific logo sizing */
  .auth-logo img {
    max-height: 40px;
    width: auto;
  }

  /* Mobile alert styling */
  .auth-dark-theme .alert {
    padding: var(--auth-spacing-md);
    font-size: var(--auth-font-sm);
    margin-bottom: var(--auth-spacing-lg);
  }

  /* Mobile link spacing */
  .auth-form-container a {
    display: inline-block;
    padding: var(--auth-spacing-xs) 0;
    min-height: var(--auth-touch-target-min);
    line-height: 1.4;
  }
}

/* Small mobile devices (480px - 575px) - Standard phones */
@media (min-width: 480px) and (max-width: 575.98px) {
  :root {
    --auth-container-padding: 1rem;
    --auth-form-padding: 1.5rem;
  }

  .auth-container {
    padding-top: 2.5rem;
  }

  .auth-form-container {
    margin: 0 auto;
    max-width: 400px;
  }

  .auth-dark-theme .auth-title {
    font-size: var(--auth-font-3xl);
  }

  .auth-logo img {
    max-height: 50px;
  }
}

/* Small devices (576px - 767px) - Large phones, small tablets */
@media (min-width: 576px) and (max-width: 767.98px) {
  :root {
    --auth-container-padding: 1.25rem;
    --auth-form-padding: 2rem;
  }

  .auth-container {
    padding-top: 3rem;
  }

  .auth-form-container {
    max-width: 420px;
  }

  .auth-dark-theme .auth-title {
    font-size: var(--auth-font-3xl);
  }

  /* Touch-optimized buttons for small tablets */
  .auth-dark-theme .btn-primary,
  .auth-dark-theme .btn-secondary {
    padding: var(--auth-spacing-lg) var(--auth-spacing-xl);
    min-height: var(--auth-touch-target-min);
  }

  .auth-logo img {
    max-height: 55px;
  }
}

/* Medium devices (768px - 991px) - Tablets */
@media (min-width: 768px) and (max-width: 991.98px) {
  :root {
    --auth-container-padding: 2rem;
    --auth-form-padding: 2.5rem;
  }

  .auth-container {
    align-items: center;
    padding-top: 0;
  }

  .auth-form-container {
    max-width: 480px;
  }

  .auth-form-container.wide {
    max-width: 560px;
  }

  .auth-dark-theme .auth-title {
    font-size: var(--auth-font-4xl);
    margin-bottom: var(--auth-spacing-xl);
  }

  .auth-dark-theme .auth-subtitle {
    font-size: var(--auth-font-lg);
    margin-bottom: var(--auth-spacing-xl);
  }

  /* Tablet-optimized form controls */
  .auth-dark-theme .form-control {
    padding: var(--auth-spacing-lg) var(--auth-spacing-lg);
    font-size: var(--auth-font-lg);
  }

  .auth-dark-theme .btn-primary,
  .auth-dark-theme .btn-secondary {
    padding: var(--auth-spacing-lg) var(--auth-spacing-xxl);
    font-size: var(--auth-font-lg);
  }

  .auth-logo img {
    max-height: 60px;
  }

  /* Tablet-specific hover effects */
  .auth-form-container:hover {
    transform: translateY(-3px);
  }

  .auth-dark-theme .btn-primary:hover {
    transform: translateY(-2px);
  }
}

/* Large devices (992px - 1199px) - Small desktops */
@media (min-width: 992px) and (max-width: 1199.98px) {
  :root {
    --auth-container-padding: 2.5rem;
    --auth-form-padding: 3rem;
  }

  .auth-container {
    padding: var(--auth-container-padding);
  }

  .auth-form-container {
    max-width: 520px;
  }

  .auth-form-container.wide {
    max-width: 600px;
  }

  .auth-dark-theme .auth-title {
    font-size: var(--auth-font-4xl);
    margin-bottom: var(--auth-spacing-xl);
  }

  .auth-logo img {
    max-height: 65px;
  }

  /* Desktop hover enhancements */
  .auth-form-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--auth-shadow-heavy);
  }

  .auth-dark-theme .form-control:hover {
    transform: translateY(-1px);
  }

  .auth-dark-theme .btn-primary:hover {
    transform: translateY(-3px);
  }
}

/* Extra large devices (1200px - 1399px) - Large desktops */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .auth-form-container {
    max-width: 560px;
  }

  .auth-form-container.wide {
    max-width: 640px;
  }

  .auth-logo img {
    max-height: 70px;
  }
}

/* Ultra-wide devices (1400px and up) - Ultra-wide monitors */
@media (min-width: 1400px) {
  :root {
    --auth-container-padding: 3rem;
    --auth-form-padding: 3.5rem;
  }

  .auth-form-container {
    max-width: 600px;
  }

  .auth-form-container.wide {
    max-width: 700px;
  }

  .auth-dark-theme .auth-title {
    font-size: 2.5rem;
  }

  .auth-logo img {
    max-height: 75px;
  }
}

/* ===== Orientation-Based Responsive Design ===== */

/* Landscape orientation on mobile devices */
@media (max-width: 767.98px) and (orientation: landscape) {
  .auth-container {
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .auth-form-container {
    margin-top: 0;
    margin-bottom: 0;
  }

  .auth-dark-theme .auth-title {
    font-size: var(--auth-font-2xl);
    margin-bottom: var(--auth-spacing-md);
  }

  .auth-dark-theme .auth-subtitle {
    margin-bottom: var(--auth-spacing-md);
  }

  .auth-logo {
    margin-bottom: var(--auth-spacing-md);
  }

  .auth-logo img {
    max-height: 35px;
  }
}

/* Portrait orientation on tablets */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .auth-form-container {
    max-width: 500px;
  }

  .auth-form-container.wide {
    max-width: 580px;
  }
}

/* ===== Touch Device Optimizations ===== */

/* Enhanced touch targets for all touch devices */
@media (pointer: coarse) {
  .auth-dark-theme .btn-primary,
  .auth-dark-theme .btn-secondary,
  .auth-dark-theme .btn-outline-primary {
    min-height: var(--auth-touch-target-comfortable);
    padding: var(--auth-spacing-lg) var(--auth-spacing-xl);
  }

  .auth-dark-theme .form-control {
    min-height: var(--auth-touch-target-comfortable);
    padding: var(--auth-spacing-lg) var(--auth-spacing-md);
  }

  .auth-dark-theme .form-check-input {
    width: 20px;
    height: 20px;
    margin-right: var(--auth-spacing-sm);
  }

  .auth-dark-theme .form-check-label {
    padding-left: var(--auth-spacing-sm);
    min-height: var(--auth-touch-target-min);
    display: flex;
    align-items: center;
  }

  /* Touch-friendly links */
  .auth-form-container a {
    padding: var(--auth-spacing-sm) 0;
    min-height: var(--auth-touch-target-min);
    display: inline-flex;
    align-items: center;
  }
}

/* ===== High-DPI Display Optimizations ===== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .auth-logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }

  .auth-form-container {
    border-width: 0.5px;
  }

  .auth-dark-theme .form-control {
    border-width: 0.5px;
  }
}

/* ===== Viewport Height Optimizations ===== */

/* Short viewport height (landscape phones, short tablets) */
@media (max-height: 600px) {
  .auth-container {
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
    min-height: auto;
  }

  .auth-dark-theme .auth-title {
    margin-bottom: var(--auth-spacing-md);
  }

  .auth-dark-theme .auth-subtitle {
    margin-bottom: var(--auth-spacing-md);
  }

  .auth-logo {
    margin-bottom: var(--auth-spacing-md);
  }

  .auth-dark-theme .form-group {
    margin-bottom: var(--auth-spacing-md);
  }
}

/* Very short viewport height */
@media (max-height: 480px) {
  .auth-container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .auth-form-container {
    padding: var(--auth-spacing-lg);
  }

  .auth-logo {
    margin-bottom: var(--auth-spacing-sm);
  }

  .auth-logo img {
    max-height: 30px;
  }

  .auth-dark-theme .auth-title {
    font-size: var(--auth-font-xl);
    margin-bottom: var(--auth-spacing-sm);
  }

  .auth-dark-theme .auth-subtitle {
    font-size: var(--auth-font-sm);
    margin-bottom: var(--auth-spacing-sm);
  }
}

/* ===== Container Query Support (Future-proofing) ===== */

@supports (container-type: inline-size) {
  .auth-form-container {
    container-type: inline-size;
  }

  @container (max-width: 400px) {
    .auth-dark-theme .auth-title {
      font-size: var(--auth-font-2xl);
    }

    .auth-dark-theme .btn-primary {
      width: 100%;
    }
  }
}

/* ===== Print Optimizations ===== */

@media print {
  .auth-container {
    padding: 1rem;
    background: white !important;
  }

  .auth-form-container {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
    max-width: none !important;
  }

  .auth-dark-theme .auth-title,
  .auth-dark-theme .auth-subtitle,
  .auth-dark-theme p,
  .auth-dark-theme label {
    color: #000 !important;
  }
}

/* ===== Accessibility Enhancements ===== */

/* Focus indicators for keyboard navigation */
.auth-dark-theme *:focus {
  outline: 2px solid var(--auth-accent-primary);
  outline-offset: 2px;
}

.auth-dark-theme .form-control:focus {
  outline: none; /* Custom focus styling already applied above */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --auth-form-bg: rgba(255, 255, 255, 0.2);
    --auth-form-border: rgba(255, 255, 255, 0.4);
    --auth-text-secondary: #e5e7eb;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .auth-dark-theme * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .auth-form-container:hover {
    transform: none;
  }

  .auth-dark-theme .btn-primary:hover {
    transform: none;
  }
}

/* ===== Enhanced Utility Classes for Transparent Containers ===== */

.auth-text-center {
  text-align: center;
}

.auth-text-left {
  text-align: left;
}

.auth-text-right {
  text-align: right;
}

.auth-mb-1 { margin-bottom: 0.5rem; }
.auth-mb-2 { margin-bottom: 1rem; }
.auth-mb-3 { margin-bottom: 1.5rem; }
.auth-mb-4 { margin-bottom: 2rem; }

.auth-mt-1 { margin-top: 0.5rem; }
.auth-mt-2 { margin-top: 1rem; }
.auth-mt-3 { margin-top: 1.5rem; }
.auth-mt-4 { margin-top: 2rem; }

/* Enhanced loading states */
.auth-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.auth-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: auth-spin 1s linear infinite;
}

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

/* ===== Transparent Container Variants ===== */

/* Compact form container */
.auth-form-container.compact {
  padding: 1.5rem;
  max-width: 350px;
}

/* Wide form container for complex forms */
.auth-form-container.wide {
  max-width: 600px;
  padding: 3rem;
}

/* Minimal transparency variant */
.auth-form-container.minimal {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* High transparency variant */
.auth-form-container.high-transparency {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
}

/* Glass morphism effect */
.auth-form-container.glass {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(20px) saturate(180%) brightness(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ===== Form Container Animations ===== */

/* Fade in animation */
.auth-form-container.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

/* Scale in animation */
.auth-form-container.scale-in {
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide in from bottom animation */
.auth-form-container.slide-up {
  animation: slideUp 0.6s ease-out;
}

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

/* ===== Interactive Elements ===== */

/* Enhanced link styling within transparent containers */
.auth-form-container a {
  color: var(--auth-accent-primary);
  text-decoration: none;
  transition: all var(--auth-transition-fast);
  position: relative;
}

.auth-form-container a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--auth-accent-primary);
  transition: width var(--auth-transition-fast);
}

.auth-form-container a:hover::after {
  width: 100%;
}

.auth-form-container a:hover {
  color: var(--auth-accent-hover);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

/* Divider styling */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
  color: var(--auth-text-muted);
  font-size: 0.875rem;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
}

.auth-divider span {
  background: rgba(10, 14, 39, 0.8);
  padding: 0 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===== Print Styles ===== */
@media print {
  .auth-dark-theme {
    background: white !important;
    color: black !important;
  }

  .auth-form-container {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ===== Advanced Responsive Utilities ===== */

/* Responsive visibility utilities */
.auth-hide-mobile {
  display: block;
}

.auth-show-mobile {
  display: none;
}

@media (max-width: 767.98px) {
  .auth-hide-mobile {
    display: none !important;
  }

  .auth-show-mobile {
    display: block !important;
  }
}

.auth-hide-tablet {
  display: block;
}

.auth-show-tablet {
  display: none;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .auth-hide-tablet {
    display: none !important;
  }

  .auth-show-tablet {
    display: block !important;
  }
}

.auth-hide-desktop {
  display: block;
}

.auth-show-desktop {
  display: none;
}

@media (min-width: 1025px) {
  .auth-hide-desktop {
    display: none !important;
  }

  .auth-show-desktop {
    display: block !important;
  }
}

/* ===== Responsive Typography Utilities ===== */

.auth-text-responsive {
  font-size: var(--auth-font-sm);
  line-height: 1.4;
}

@media (min-width: 576px) {
  .auth-text-responsive {
    font-size: var(--auth-font-base);
    line-height: 1.5;
  }
}

@media (min-width: 768px) {
  .auth-text-responsive {
    font-size: var(--auth-font-lg);
    line-height: 1.6;
  }
}

/* ===== Responsive Spacing Utilities ===== */

.auth-p-responsive {
  padding: var(--auth-spacing-sm);
}

@media (min-width: 576px) {
  .auth-p-responsive {
    padding: var(--auth-spacing-md);
  }
}

@media (min-width: 768px) {
  .auth-p-responsive {
    padding: var(--auth-spacing-lg);
  }
}

@media (min-width: 992px) {
  .auth-p-responsive {
    padding: var(--auth-spacing-xl);
  }
}

.auth-m-responsive {
  margin: var(--auth-spacing-sm);
}

@media (min-width: 576px) {
  .auth-m-responsive {
    margin: var(--auth-spacing-md);
  }
}

@media (min-width: 768px) {
  .auth-m-responsive {
    margin: var(--auth-spacing-lg);
  }
}

@media (min-width: 992px) {
  .auth-m-responsive {
    margin: var(--auth-spacing-xl);
  }
}

/* ===== Responsive Grid System for Auth Forms ===== */

.auth-grid {
  display: grid;
  gap: var(--auth-spacing-md);
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .auth-grid-sm-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .auth-grid-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-grid-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .auth-grid-lg-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-grid-lg-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .auth-grid-lg-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== Responsive Form Layout Enhancements ===== */

/* Stacked form layout for mobile */
@media (max-width: 767.98px) {
  .auth-form-row {
    display: flex;
    flex-direction: column;
    gap: var(--auth-spacing-md);
  }

  .auth-form-col {
    width: 100%;
  }
}

/* Side-by-side form layout for tablets and up */
@media (min-width: 768px) {
  .auth-form-row {
    display: flex;
    flex-direction: row;
    gap: var(--auth-spacing-lg);
    align-items: flex-start;
  }

  .auth-form-col {
    flex: 1;
  }

  .auth-form-col-auto {
    flex: 0 0 auto;
  }
}

/* ===== Responsive Image and Media Handling ===== */

.auth-responsive-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--auth-border-radius-small);
}

.auth-qr-code {
  max-width: 200px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

@media (min-width: 576px) {
  .auth-qr-code {
    max-width: 250px;
  }
}

@media (min-width: 768px) {
  .auth-qr-code {
    max-width: 300px;
  }
}

/* ===== Responsive Button Groups ===== */

.auth-button-group {
  display: flex;
  flex-direction: column;
  gap: var(--auth-spacing-md);
}

@media (min-width: 576px) {
  .auth-button-group-sm-row {
    flex-direction: row;
    justify-content: center;
  }

  .auth-button-group-sm-row .btn {
    flex: 0 1 auto;
    min-width: 120px;
  }
}

@media (min-width: 768px) {
  .auth-button-group-md-row {
    flex-direction: row;
    justify-content: center;
  }

  .auth-button-group-md-row .btn {
    flex: 0 1 auto;
    min-width: 140px;
  }
}

/* ===== Responsive Alert and Message Styling ===== */

@media (max-width: 575.98px) {
  .auth-dark-theme .alert {
    padding: var(--auth-spacing-sm) var(--auth-spacing-md);
    font-size: var(--auth-font-sm);
    border-radius: var(--auth-border-radius-small);
  }

  .auth-dark-theme .alert h4,
  .auth-dark-theme .alert h5,
  .auth-dark-theme .alert h6 {
    font-size: var(--auth-font-base);
    margin-bottom: var(--auth-spacing-xs);
  }
}

/* ===== Responsive Navigation and Links ===== */

.auth-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--auth-spacing-sm);
  text-align: center;
}

@media (min-width: 576px) {
  .auth-nav-links {
    flex-direction: row;
    justify-content: center;
    gap: var(--auth-spacing-lg);
  }
}

.auth-nav-links a {
  padding: var(--auth-spacing-sm) var(--auth-spacing-md);
  border-radius: var(--auth-border-radius-small);
  transition: all var(--auth-transition-fast);
  min-height: var(--auth-touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-nav-links a:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ===== Responsive Code and Pre-formatted Text ===== */

.auth-code-block {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--auth-form-border);
  border-radius: var(--auth-border-radius-small);
  padding: var(--auth-spacing-md);
  font-family: 'Courier New', monospace;
  font-size: var(--auth-font-sm);
  color: var(--auth-text-primary);
  word-break: break-all;
  overflow-wrap: break-word;
}

@media (min-width: 576px) {
  .auth-code-block {
    font-size: var(--auth-font-base);
    word-break: normal;
  }
}

/* ===== Responsive Loading States ===== */

.auth-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top: 3px solid var(--auth-accent-primary);
  border-radius: 50%;
  animation: auth-spin 1s linear infinite;
}

@media (min-width: 768px) {
  .auth-loading-spinner {
    width: 50px;
    height: 50px;
    border-width: 4px;
  }
}

/* ===== Responsive Accessibility Enhancements ===== */

/* Skip link for keyboard navigation */
.auth-skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--auth-accent-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  transition: top var(--auth-transition-fast);
}

.auth-skip-link:focus {
  top: 6px;
}

/* Enhanced focus indicators for mobile */
@media (max-width: 767.98px) {
  .auth-dark-theme *:focus {
    outline: 3px solid var(--auth-accent-primary);
    outline-offset: 3px;
  }
}

/* ===== Responsive Performance Optimizations ===== */

/* Reduce complexity on low-end devices */
@media (max-width: 480px) and (max-height: 800px) {
  .auth-form-container::before,
  .auth-form-container::after {
    display: none;
  }

  .auth-form-container {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--auth-bg-secondary);
  }
}

/* GPU acceleration hints for smooth scrolling */
.auth-container,
.auth-form-container {
  transform: translateZ(0);
  will-change: transform;
}

/* ===== Responsive Debug Utilities (Development Only) ===== */

.auth-debug-breakpoint {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  z-index: 10000;
  display: none;
}

/* Uncomment for debugging breakpoints */
/*
@media (max-width: 479.98px) {
  .auth-debug-breakpoint::after { content: "XS"; display: block; }
}

@media (min-width: 480px) and (max-width: 575.98px) {
  .auth-debug-breakpoint::after { content: "SM"; display: block; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .auth-debug-breakpoint::after { content: "MD"; display: block; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .auth-debug-breakpoint::after { content: "LG"; display: block; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .auth-debug-breakpoint::after { content: "XL"; display: block; }
}

@media (min-width: 1200px) {
  .auth-debug-breakpoint::after { content: "XXL"; display: block; }
}
*/
/* ===== Copyright Footer Styling ===== */

.auth-copyright-footer {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  padding: 1rem 0;
  z-index: 5;
}

.auth-dark-theme .auth-copyright-footer .text-muted {
  color: var(--auth-text-muted) !important;
  font-size: var(--auth-font-sm);
  opacity: 0.7;
  transition: opacity var(--auth-transition-fast);
  margin: 0;
  padding: 0;
}

.auth-dark-theme .auth-copyright-footer .text-muted:hover {
  opacity: 0.9;
}

/* Responsive copyright footer */
@media (max-width: 575.98px) {
  .auth-copyright-footer {
    bottom: 1rem;
    padding: 0.5rem 0;
  }

  .auth-dark-theme .auth-copyright-footer .text-muted {
    font-size: var(--auth-font-xs);
  }
}

@media (min-width: 768px) {
  .auth-copyright-footer {
    bottom: 2rem;
    padding: 1rem 0;
  }

  .auth-dark-theme .auth-copyright-footer .text-muted {
    font-size: var(--auth-font-sm);
  }
}
