/*
 * ITA Events Login Page - Luxury Tech Authentication Experience
 * Design Philosophy: "Premium Glassmorphism" - World-Class Design
 * No containers, pure floating elements on gradient background
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================================
   DESIGN TOKENS - LUXURY TECH PALETTE
   ============================================================================ */

:root {
  /* Premium Blue Spectrum */
  --primary-50: #e6f4ff;
  --primary-100: #bae0ff;
  --primary-200: #91caff;
  --primary-300: #69b1ff;
  --primary-400: #4096ff;
  --primary-500: #1677ff;
  --primary-600: #0958d9;
  --primary-700: #003eb3;
  --primary-800: #002c8c;
  --primary-900: #001d66;

  /* Accent Colors */
  --accent-cyan: #2d7ff9;
  --accent-electric: #4c8dff;
  --accent-sapphire: #0050b3;
  --accent-deep-navy: #0a1929;
  --accent-royal: #2563eb;
  --accent-sky: #3b82f6;

  /* Neutral Palette */
  --neutral-50: #fafbfc;
  --neutral-100: #f5f7fa;
  --neutral-200: #edf0f5;
  --neutral-300: #e2e8f0;
  --neutral-400: #cbd5e1;
  --neutral-500: #94a3b8;
  --neutral-600: #64748b;
  --neutral-700: #475569;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  /* Spacing System */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.5rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-10: 5rem;
  --space-12: 6rem;

  /* Typography */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.563rem;
  --text-3xl: 1.953rem;
  --text-4xl: 2.441rem;
  --text-5xl: 3.052rem;
  --text-6xl: 3.815rem;

  /* Font Families */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================================
   BASE SETUP - FULL SCREEN GRADIENT
   ============================================================================ */

body.login-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  background: linear-gradient(140deg,
    var(--accent-deep-navy) 0%,
    var(--primary-800) 25%,
    var(--primary-700) 50%,
    var(--primary-600) 75%,
    var(--accent-sapphire) 100%
  );
  background-attachment: fixed;
}

body.login-page main {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  width: 100vw;
}

/* Animated gradient mesh background */
.login-wrapper {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* Subtle grain texture overlay */
.login-wrapper::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: soft-light;
}

/* Floating animated orbs - Optimized for performance */
.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.login-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-royal), transparent);
  top: -15%;
  right: -10%;
  animation: float-1 30s ease-in-out infinite;
}

.login-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-sky), transparent);
  bottom: -20%;
  left: -15%;
  animation: float-2 25s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 30px); }
}

/* ============================================================================
   LOGO - CLICKABLE BACK BUTTON
   ============================================================================ */

.login-logo {
  position: fixed;
  top: 12px;
  left: var(--space-6);
  z-index: 1000;
}

.login-logo a {
  display: block;
  cursor: pointer;
}

.login-logo img {
  max-width: 180px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* ============================================================================
   MAIN CONTENT - CENTERED LAYOUT
   ============================================================================ */

.login-content {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-8) var(--space-4);
}

/* ============================================================================
   LUXURY GLASSMORPHIC FORM - NO WHITE CONTAINER
   ============================================================================ */

.login-form-container {
  width: 100%;
  max-width: 520px;
}

/* Header Section */
.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 5vw, var(--text-5xl));
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.03em;
  text-shadow:
    0 2px 20px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(59, 130, 246, 0.3);
}

.login-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Form Wrapper */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Validation Summary */
.validation-summary-errors {
  background: rgba(220, 53, 69, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(220, 53, 69, 0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  color: #ffffff;
  font-size: var(--text-sm);
  box-shadow: 0 8px 32px rgba(220, 53, 69, 0.3);
  margin-bottom: var(--space-4);
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: var(--space-4);
}

/* Glassmorphic Form Groups */
.form-floating {
  position: relative;
  margin-bottom: var(--space-4);
}

/* Password Toggle Button */
.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.125rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  z-index: 10;
}

.password-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.password-toggle:focus {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

/* Adjust password input padding to make room for toggle */
.form-floating.has-toggle .form-control {
  padding-right: 3.5rem;
}

.form-control {
  width: 100%;
  padding: 1.5rem 1.25rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  box-shadow:
    0 8px 32px rgba(31, 38, 135, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-text-fill-color: #ffffff;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.1) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-control:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.form-control:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.15),
    0 8px 32px rgba(31, 38, 135, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Floating Labels */
.form-floating > label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 1.25rem 1.25rem 0;
  pointer-events: none;
  transform-origin: 0 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  font-size: var(--text-base);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  opacity: 1;
  transform: scale(0.8) translateY(-0.5rem) translateX(0.15rem);
  font-size: var(--text-sm);
}

/* Validation Messages */
.text-danger {
  position: absolute;
  bottom: -1.5rem;
  left: 0;
  color: #ff0000;
  font-size: var(--text-sm);
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

/* Remember Me Checkbox */
.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(31, 38, 135, 0.15);
  margin-bottom: var(--space-4);
}

.checkbox:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.checkbox label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #ffffff;
  user-select: none;
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.35rem;
  cursor: pointer;
  transition: all var(--transition-base);
  background: rgba(255, 255, 255, 0.1);
  appearance: none;
  flex-shrink: 0;
}

.form-check-input:checked {
  background: linear-gradient(135deg, var(--accent-royal), var(--accent-sky));
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
  position: relative;
}

.form-check-input:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.875rem;
  font-weight: bold;
}

.form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

/* Premium Sign In Button */
.btn-login {
  position: relative;
  width: 100%;
  padding: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-royal), var(--accent-sky));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow:
    0 12px 40px rgba(37, 99, 235, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  margin-bottom: var(--space-3);
}

/* Shimmer effect */
.btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.7s ease;
}

.btn-login:hover {
  box-shadow:
    0 16px 50px rgba(37, 99, 235, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:active {
  transform: scale(0.98);
}

.btn-login:focus {
  outline: 3px solid rgba(59, 130, 246, 0.4);
  outline-offset: 4px;
}

/* Forgot Password & Privacy Policy Links */
.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.login-footer a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  padding-bottom: 2px;
}

.login-footer a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-royal), var(--accent-sky));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
  border-radius: 2px;
}

.login-footer a:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

.login-footer a:hover::after {
  transform: scaleX(1);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Desktop - Wider Form */
@media (min-width: 1024px) {
  .login-form-container {
    max-width: 600px;
  }

  .login-title {
    font-size: var(--text-6xl);
  }
}

/* Tablet */
@media (max-width: 767px) {
  .login-logo {
    top: 12px;
    left: var(--space-3);
  }

  .login-logo img {
    max-width: 120px;
  }

  .login-content {
    padding: var(--space-8) var(--space-3);
  }

  .login-title {
    font-size: var(--text-4xl);
  }

  .login-subtitle {
    font-size: var(--text-xl);
  }

  .login-orb-1,
  .login-orb-2 {
    width: 350px;
    height: 350px;
    filter: blur(40px);
  }

  .login-footer {
    flex-direction: column;
    text-align: center;
    gap: var(--space-2);
  }
}

/* Mobile */
@media (max-width: 639px) {
  .login-logo {
    top: 8px;
    left: var(--space-2);
  }

  .login-logo img {
    max-width: 100px;
  }

  .login-content {
    padding: var(--space-6) var(--space-2);
  }

  .login-header {
    margin-bottom: var(--space-6);
  }

  .login-title {
    font-size: var(--text-3xl);
  }

  .login-subtitle {
    font-size: var(--text-lg);
  }

  .btn-login {
    padding: var(--space-3);
    font-size: var(--text-base);
  }

  .login-orb-1,
  .login-orb-2 {
    width: 250px;
    height: 250px;
    filter: blur(30px);
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .login-bg-orb {
    animation: none !important;
  }
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.6);
  outline-offset: 4px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .form-control {
    border-width: 2px;
  }

  .btn-login {
    border-width: 2px;
  }
}
