/* ==========================================================================
   Rougier et Fils / Le Coeur des Champs - Login Custom Stylesheet
   Modern, Glassmorphism, Premium Design & Fluid Animations
   ========================================================================== */

:root {
  --login-bg-primary: #0a0f1d;
  --login-bg-secondary: #131c31;
  --login-accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  --login-accent-glow: rgba(16, 185, 129, 0.4);
  --login-accent-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --login-card-bg: rgba(255, 255, 255, 0.04);
  --login-card-border: rgba(255, 255, 255, 0.12);
  --login-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(16, 185, 129, 0.1);
  --login-text-main: #f8fafc;
  --login-text-muted: #94a3b8;
  --login-input-bg: rgba(15, 23, 42, 0.6);
  --login-input-border: rgba(255, 255, 255, 0.15);
  --login-input-focus: #10b981;
  --login-error-bg: rgba(239, 68, 68, 0.15);
  --login-error-border: rgba(239, 68, 68, 0.4);
  --login-error-text: #fca5a5;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Base Container & Mesh Background */
.login-page-body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--login-bg-primary);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.login-bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.login-glow-orb-1 {
  width: 500px;
  height: 500px;
  background: #059669;
  top: -100px;
  left: -100px;
}

.login-glow-orb-2 {
  width: 450px;
  height: 450px;
  background: #1d4ed8;
  bottom: -100px;
  right: -50px;
  animation-delay: -9s;
}

.login-glow-orb-3 {
  width: 350px;
  height: 350px;
  background: #047857;
  top: 40%;
  left: 60%;
  animation-delay: -4s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 70px) scale(0.95); }
}

/* Login Wrapper Card */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1000px;
  margin: 2rem 1rem;
  animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-card-container {
  background: var(--login-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--login-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--login-card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: row;
}

/* Left Hero Branding Section */
.login-brand-panel {
  flex: 1;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(19, 28, 49, 0.85) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--login-accent-gradient);
}

.login-brand-header {
  position: relative;
  z-index: 2;
  text-align: center;
}

.login-logo-wrapper {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.login-logo-img {
  max-height: 85px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
  margin: 0 auto;
  display: block;
}

.login-logo-img:hover {
  transform: scale(1.03);
}

.login-brand-title {
  color: #ffffff;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.login-brand-subtitle {
  color: #a7f3d0;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.5;
}

.login-brand-illustration {
  margin: 2.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.6rem 1.1rem;
  border-radius: 30px;
  color: #6ee7b7;
  font-size: 0.875rem;
  font-weight: 600;
}

.login-brand-footer {
  color: var(--login-text-muted);
  font-size: 0.825rem;
  z-index: 2;
  text-align: center;
}

/* Right Form Section */
.login-form-panel {
  flex: 1.15;
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(10, 15, 29, 0.5);
}

.login-form-header {
  margin-bottom: 2.25rem;
}

.login-form-title {
  color: var(--login-text-main);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.login-form-desc {
  color: var(--login-text-muted);
  font-size: 0.95rem;
}

/* Form Controls */
.login-input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.login-input-group label {
  display: block;
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

.login-input-icon {
  position: absolute;
  left: 1.1rem;
  color: #64748b;
  font-size: 1.1rem;
  transition: color 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

.login-input {
  width: 100%;
  background: var(--login-input-bg);
  border: 1px solid var(--login-input-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem 0.85rem 2.9rem;
  color: #ffffff;
  font-size: 0.975rem;
  font-weight: 500;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.login-input::placeholder {
  color: #475569;
}

.login-input:focus {
  border-color: var(--login-input-focus);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18), inset 0 2px 4px rgba(0,0,0,0.2);
}

.login-input:focus ~ .login-input-icon,
.login-input-wrapper:focus-within .login-input-icon {
  color: #10b981;
}

/* Password Toggle Eye Icon */
.login-pw-toggle {
  position: absolute;
  right: 1.1rem;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  z-index: 3;
}

.login-pw-toggle:hover {
  color: #10b981;
}

/* Checkbox Styling */
.login-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.custom-checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  color: var(--login-text-muted);
  font-size: 0.9rem;
}

.custom-checkbox-container input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  background: var(--login-input-bg);
  border: 1px solid var(--login-input-border);
  border-radius: 6px;
  margin-right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.custom-checkbox-container input:checked ~ .checkmark {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: #ffffff;
  font-size: 0.7rem;
  display: none;
}

.custom-checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

/* Submit Button */
.btn-login-submit {
  width: 100%;
  padding: 0.95rem;
  background: var(--login-accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--login-accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.btn-login-submit::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transform: rotate(30deg) translateY(-100%);
  transition: transform 0.6s ease;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-login-submit:hover::after {
  transform: rotate(30deg) translateY(100%);
}

.btn-login-submit:active {
  transform: translateY(0);
}

/* PIN Code Inputs Grid */
.pin-input-grid {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pin-field-item {
  flex: 1;
  max-width: 72px;
}

.pin-input-box {
  width: 100%;
  height: 72px;
  background: var(--login-input-bg);
  border: 2px solid var(--login-input-border);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
  -moz-appearance: textfield;
  appearance: textfield;
}

.pin-input-box::-webkit-outer-spin-button,
.pin-input-box::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pin-input-box:focus {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25), inset 0 2px 4px rgba(0,0,0,0.2);
  transform: scale(1.05);
}

.pin-input-box.filled {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(15, 23, 42, 0.9);
}

/* Error Toast / Alert Box */
.login-alert-toast {
  display: none;
  margin-top: 1.5rem;
  background: var(--login-error-bg);
  border: 1px solid var(--login-error-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: var(--login-error-text);
  font-size: 0.925rem;
  font-weight: 600;
  align-items: center;
  gap: 0.75rem;
  animation: shakeError 0.4s ease-in-out forwards;
}

.login-alert-toast.show {
  display: flex;
}

.login-alert-icon {
  font-size: 1.25rem;
  color: #ef4444;
}

/* Keyframe Animations */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .login-card-container {
    flex-direction: column;
  }

  .login-brand-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2.5rem 2rem;
    text-align: center;
  }

  .login-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .login-brand-illustration {
    display: none;
  }

  .login-form-panel {
    padding: 2.5rem 2rem;
  }
}

@media (max-width: 480px) {
  .login-wrapper {
    margin: 1rem 0.5rem;
  }

  .login-brand-panel {
    padding: 2rem 1.25rem;
  }

  .login-form-panel {
    padding: 2rem 1.25rem;
  }

  .pin-input-grid {
    gap: 0.5rem;
  }

  .pin-input-box {
    height: 60px;
    font-size: 1.6rem;
  }
}
