/* Modern Login Design */

/* CSS Variables for Design System */
:root {
  --reflex-blue: 229 49% 41%;
  --red-highlight: 4 85% 51%;
  --cool-gray: 224 3% 40%;
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 229 49% 41%;
  --radius: 0.5rem;
}

/* Utility Classes */
.bg-reflex-blue {
  background-color: hsl(var(--reflex-blue));
}

.text-reflex-blue {
  color: hsl(var(--reflex-blue));
}

.bg-red-highlight {
  background-color: hsl(var(--red-highlight));
}

.text-red-highlight {
  color: hsl(var(--red-highlight));
}

.text-cool-gray {
  color: hsl(var(--cool-gray));
}

/* Login Page Layout */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-main {
  flex: 1;
  display: flex;
}

/* Left Side - Hero Section */
.login-hero {
  display: none;
  flex: 1;
  position: relative;
  overflow: hidden;
  background: url(https://media.ids-nurture.com/ids_nurture_rebranding/DashboardLoginHero.png) no-repeat center center;
  background-size: cover;
}

@media (min-width: 1024px) {
  .login-hero {
    display: flex;
  }
}

/* Animated Background Elements */
.login-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16rem;
  height: 16rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(2rem);
  animation: pulse 4s ease-in-out infinite 0.5s;
}

/* Large white box - positioned above title */
.login-hero-top-left-box {
  position: absolute;
  top: 5rem;
  left: 5rem;
  width: 16rem;
  height: 16rem;
  border: 1px solid white;
  transform: rotate(45deg);
  animation: spin 20s linear infinite;
  opacity: 0.9;
  z-index: 5;
}

/* Smaller white box - positioned at the bottom right */
.login-hero-bottom-right-box {
  position: absolute;
  bottom: 8rem;
  right: 2.5rem;
  width: 10rem;
  height: 10rem;
  border: 1px solid white;
  transform: rotate(12deg);
  animation: bounce 2s ease-in-out infinite;
}

/* Hero Content */
.login-hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem;
  color: white;
}

.login-hero-title {
  font-size: 6rem;
  font-weight: bold;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.login-hero-title span {
  display: block;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.login-hero-subtitle {
  font-size: 2rem;
  color: #d1d5db;
  line-height: 1.6;
  max-width: 48rem;
  margin-bottom: 4rem;
}

/* Feature Cards */
.login-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 40rem;
}

.login-feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.5rem;
  padding: 2.5rem;
  transition: all 0.3s ease;
}

.login-feature-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-feature-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.login-feature-icon {
  padding: 1.25rem;
  background: rgba(220, 38, 38, 0.3);
  border-radius: 1rem;
  transition: background-color 0.3s ease;
}

.login-feature-card:hover .login-feature-icon {
  background: rgba(220, 38, 38, 0.5);
}

.login-feature-icon i {
  font-size: 2.5rem;
  color: hsl(var(--red-highlight));
}

.login-feature-text h3 {
  font-weight: bold;
  color: white;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.login-feature-text p {
  font-size: 1.25rem;
  color: #d1d5db;
}

/* Right Side - Login Form */
.login-form-section {
  flex: 1;
  max-width: 58rem; 
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Subtle Background Pattern */
.login-form-section::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
  background-size: 3rem 3rem;
}

.login-form-container {
  width: 100%;
  max-width: 45rem;
  position: relative;
  z-index: 10;
}

/* IDS App Logo */
.login-logo {
  text-align: center;
}

.login-logo img {
  height: 8rem;
  width: auto;
  margin: 0 auto 1rem;
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 4rem;
}

.login-header h2 {
  font-size: 4rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 1rem;
}

.login-header p {
  color: hsl(var(--cool-gray));
  font-size: 1.75rem;
}

/* Login Card */
.login-card {
  border: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.login-card-content {
  position: relative;
  z-index: 10;
}

.login-card-header {
  padding: 4rem 3rem 3rem;
  text-align: center;
}

.login-card-header h3 {
  font-size: 2.5rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 0.5rem;
}

.login-card-header p {
  color: hsl(var(--cool-gray));
  margin-top: 0.5rem;
  font-size: 1.5rem;
}

.login-card-body {
  padding: 0 3rem 4rem;
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.login-form-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
}

.login-form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-form-input-wrapper i {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--cool-gray));
  font-size: 1.5rem; /* Reduced for more modern look */
  transition: color 0.3s ease;
  opacity: 0.7; /* More subtle like prototype */
}

.login-form-input-wrapper:focus-within i {
  color: hsl(var(--reflex-blue));
}

.login-form-input {
  width: 100%;
  padding: 2rem 4rem 2rem 4.5rem;
  height: 6rem; 
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
}

.login-form-input:focus {
  outline: none;
  border-color: hsl(var(--reflex-blue));
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2);
}

.login-form-input::placeholder {
  color: #9ca3af;
}

/* Password Toggle */
.login-password-toggle {
  position: absolute;
  right: 1.5rem; /* Position at the right end of the input field */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: hsl(var(--cool-gray));
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 10;
  left: auto !important; /* Override the general icon positioning */
}

.login-password-toggle:hover {
  color: hsl(var(--reflex-blue));
}

.login-password-toggle i {
  font-size: 1.25rem; /* Made smaller to ensure it fits */
  opacity: 0.7; /* More subtle like prototype */
}

/* Ensure password toggle icon doesn't inherit left positioning */
.login-form-input-wrapper .login-password-toggle {
  left: auto !important;
  right: 1.5rem !important;
}

/* More specific selector to override general icon positioning */
.login-form-input-wrapper i.login-password-toggle {
  left: auto !important;
  right: 1.5rem !important;
  position: absolute !important;
}

/* Style Crispy Forms to match modern design */
.form-signin {
  width: 100%;
}

.form-signin .form-group {
  margin-bottom: 3.5rem;
  position: relative;
}

.form-signin .form-group label {
  display: block;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.form-signin .form-group input {
  width: 100%;
  padding: 2rem 4rem 2rem 4.5rem;
  height: 6rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  position: relative;
}

.form-signin .form-group input:focus {
  outline: none;
  border-color: hsl(var(--reflex-blue));
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2);
}

.form-signin .form-group input::placeholder {
  color: #9ca3af;
}

.form-signin .btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Style form fieldset */
.form-signin fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.form-signin fieldset legend {
  display: none;
}

/* Style link-style buttons to look like a text link */
.form-signin .btn[name="forgot"],
.form-signin .btn[name="return"],
.form-signin .btn[name="back"] {
  background: transparent;
  color: hsl(var(--reflex-blue));
  border: none;
  font-weight: 500;
  font-size: 1.5rem;
  text-decoration: none;
  padding: 0;
  margin: 0;
  height: auto;
  box-shadow: none;
  transition: color 0.3s ease;
  display: block;
  text-align: right;
  margin-bottom: 1rem;
}

.form-signin .btn[name="forgot"]:hover,
.form-signin .btn[name="return"]:hover,
.form-signin .btn[name="back"]:hover {
  background: transparent;
  color: rgba(59, 130, 246, 0.8);
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.form-signin .form-group::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--cool-gray));
  font-size: 1.5rem;
  opacity: 0.7;
  z-index: 10;
}

.form-signin .form-group:has(input[name="username"])::before {
  content: '\f2bd ';  /* user icon */
  font-family: 'Font Awesome 6 Free';
  font-size: 16px;
}

.form-signin .form-group:has(input[name="password"])::before {
  content: '\f023'; /* lock icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
}

.form-signin .form-group:has(input[name="code"])::before {
  content: '\f3ed'; /* shield-alt icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
}

/* Forgot Password */
.login-forgot-password {
  display: flex;
  justify-content: flex-end;
  font-size: 1.25rem;
}

.login-forgot-password button {
  color: hsl(var(--reflex-blue));
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.login-forgot-password button:hover {
  color: rgba(59, 130, 246, 0.8);
}

/* Login Button */
.login-submit-button {
  width: 100%;
  height: 6rem;
  background: linear-gradient(90deg, #1f2937, #111827);
  color: white;
  font-weight: bold;
  font-size: 1.5rem;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: scale(1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.login-submit-button:hover {
  background: linear-gradient(90deg, #374151, #1f2937);
  transform: scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Button Shine Effect */
.login-submit-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.7s ease;
}

.login-submit-button:hover::before {
  transform: translateX(100%);
}

.login-submit-content {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Login spinner for loading states */
.login-spinner {
  animation: spin 1s linear infinite;
  border: 2px solid white;
  border-top: 2px solid transparent;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.75rem;
  display: inline-block;
}

/* Ensure button content is properly aligned during loading */
.form-signin .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Footer */
.login-footer {
  background: #1e1d1c;
  color: white;
  padding: 1rem 1.5rem;
  position: relative;
}

.login-footer-content {
  max-width: 120rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .login-footer-content {
    flex-direction: row;
    gap: 0;
  }
}

.login-footer-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-footer-left a {
  display: inline-block;
  text-decoration: none;
  position: relative;
  z-index: 10;
  cursor: pointer;
}

@media (min-width: 768px) {
  .login-footer-left {
    margin-bottom: 0;
  }
}

.login-footer-logos {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.login-footer-logo {
  width: auto;
  cursor: pointer;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.login-footer-logo.ptl-logo {
  height: 4rem;
}
.login-footer-logo.ids-logo {
  height: 2rem;
}

.login-footer-logo:hover {
  opacity: 0.8;
}

.login-footer-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: sans-serif;
  font-size: 1.3rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.login-footer-copyright {
  font-size: 1.125rem;
  font-weight: 500;
}

.login-footer-divider {
  font-size: 1.125rem;
  opacity: 0.75;
}

.login-footer-privacy {
  font-size: 1.125rem;
  color: white;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.login-footer-privacy:hover {
  color: rgba(255, 255, 255, 0.8);
}

.login-footer-privacy-link {
  text-decoration: underline;
  color: white;
  transition: color 0.3s ease;
}

.login-footer-privacy-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.login-footer-contact a {
  font-size: 1.5rem;
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.login-footer-contact a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.login-footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.login-footer-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
}

.login-footer-contact i {
  font-size: 1.25rem;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0) rotate(12deg);
  }
  50% {
    transform: translateY(-10px) rotate(12deg);
  }
}

/* Responsive Design */
@media (max-width: 1023px) {
  .login-hero {
    display: none;
  }
  
  .login-form-section {
    flex: 1;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .login-form-section {
    padding: 2rem;
  }
  
  .login-hero-content {
    padding: 3rem;
  }
  
  .login-hero-title {
    font-size: 4rem;
  }
  
  .login-header h2 {
    font-size: 3rem;
  }
  
  .login-card-header,
  .login-card-body {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  .login-footer-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .login-footer-left {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .login-footer-info {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Error Messages - Modern Design */
.login-error-messages {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 0.75rem;
  backdrop-filter: blur(12px);
}

.login-error-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: hsl(var(--red-highlight));
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Success Messages - Different styling for non-error messages */
.login-success-messages {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.75rem;
  backdrop-filter: blur(12px);
}

.login-success-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: hsl(142 76% 36%);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Info Messages - Different styling for non-error messages */
.login-info-messages {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: lightgrey;
  border-radius: 0.75rem;
  backdrop-filter: blur(12px);
}

.login-info-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Ensure messages maintain consistent styling during page load */
.login-error-message,
.login-success-message,
.login-info-message {
  position: relative;
  z-index: 10;
}

.login-error-message i,
.login-success-message i,
.login-info-message i {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.login-error-message span,
.login-success-message span,
.login-info-message span {
  flex: 1;
}

/* Dismissible Message Styles - Moved from auth templates */
.dismissible-message {
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.dismissible-message:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

#mfa-string {
  overflow-wrap: break-word
}

.mfa-qr-center {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
