/* =====================================================
   AZTEAM ERP - Modern Login Page
   Warm Brown Branding with Animated Split-Screen Design
   ===================================================== */

/* =====================================================
   COLOR VARIABLES - Warm Brown Palette
   ===================================================== */
body.login-page {
  /* Warm Brown Branding (from app.css) */
  --primary: #6b5a4a;           /* Primary actions (warm brown-gray) */
  --primary-hover: #5a4a3a;     /* Primary hover (darker warm brown) */
  --primary-light: #ede8e3;     /* Primary light bg (very light warm beige) */

  /* Neutral Warm Scale */
  --neutral-50: #faf8f3;        /* Canvas background (vintage creme) */
  --neutral-100: #eee9de;       /* Light backgrounds (warmed) */
  --neutral-200: #ddd8cc;       /* Light borders (warmed) */
  --neutral-300: #c9c3b5;       /* Borders (warmed) */
  --neutral-500: #635c54;       /* Muted text (WCAG AA compliant) */
  --neutral-600: #5a5650;       /* Secondary text */
  --neutral-700: #3a3632;       /* Primary text (warmed blend) */
  --neutral-800: #2d2a26;       /* Dark sections (warmed) */

  /* Accent Colors */
  --warning: #9a7b4f;           /* Warning states (muted brown) */
  --danger: #c85a54;            /* Danger/error states */
  --success: #6b8e6b;           /* Success states */
  --info: #5a6b5a;              /* Info states (muted teal-green) */

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(45, 42, 38, 0.08);
  --shadow-md: 0 4px 16px rgba(45, 42, 38, 0.12);
  --shadow-lg: 0 8px 32px rgba(45, 42, 38, 0.16);

  /* Fonts */
  --font-display: "Merriweather", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =====================================================
   BASE STYLES
   ===================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.login-page {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--neutral-50);
  overflow: hidden; /* Desktop only - overridden on mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   MAIN LAYOUT - Split Screen (2/3 + 1/3)
   ===================================================== */
.login-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* =====================================================
   LEFT PANEL - Animated Brand Experience (2/3)
   ===================================================== */
.brand-panel {
  position: relative;
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  overflow: hidden;
}

/* Subtle Pattern Overlay */
.brand-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(107, 90, 74, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(154, 123, 79, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(90, 107, 90, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  width: 100%;
  text-align: center;
}

/* =====================================================
   FLOATING SHAPES - Background Animation
   ===================================================== */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: floatingShapes 20s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: 10%;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 25s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: var(--warning);
  top: 60%;
  right: 15%;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation-delay: 2s;
  animation-duration: 20s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: var(--info);
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
  animation-duration: 22s;
}

.shape-4 {
  width: 250px;
  height: 250px;
  background: var(--primary);
  top: 40%;
  right: 25%;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation-delay: 1s;
  animation-duration: 28s;
}

.shape-5 {
  width: 180px;
  height: 180px;
  background: var(--warning);
  bottom: 10%;
  right: 10%;
  animation-delay: 3s;
  animation-duration: 24s;
}

@keyframes floatingShapes {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(30px, -30px) rotate(90deg) scale(1.1);
  }
  50% {
    transform: translate(-20px, 20px) rotate(180deg) scale(0.9);
  }
  75% {
    transform: translate(40px, 10px) rotate(270deg) scale(1.05);
  }
}

/* =====================================================
   LOGO
   ===================================================== */
.brand-logo {
  margin-bottom: 3rem;
  animation: fadeInScale 0.8s ease;
}

.logo-svg {
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(45, 42, 38, 0.1));
  transition: transform 0.3s ease;
}

.logo-svg:hover {
  transform: scale(1.05);
}

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

/* =====================================================
   ANIMATED TYPOGRAPHY
   ===================================================== */
.brand-title {
  margin-bottom: 3rem;
}

.animated-text {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  font-optical-sizing: auto;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  line-height: 1;
}

.letter {
  display: inline-block;
  opacity: 0;
  animation: letterReveal 0.6s forwards;
}

@keyframes letterReveal {
  from {
    opacity: 0;
    transform: translateY(30px) rotateX(-90deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.brand-tagline {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--neutral-600);
  letter-spacing: 0.05em;
  font-weight: 400;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.4s forwards;
}

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

/* =====================================================
   FEATURE ICONS
   ===================================================== */
.feature-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.feature-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards, pulseIcon 3s ease-in-out infinite;
}

.feature-icon i {
  font-size: 2.5rem;
  color: var(--primary);
  transition: all 0.3s ease;
}

.feature-icon span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-700);
  letter-spacing: 0.03em;
}

.feature-icon:hover i {
  color: var(--warning);
  transform: scale(1.15) rotate(5deg);
}

@keyframes pulseIcon {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* =====================================================
   RIGHT PANEL - Login Form (1/3)
   ===================================================== */
.form-panel {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
}

.form-container {
  width: 100%;
  max-width: 420px;
  animation: slideInRight 0.6s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =====================================================
   LOGIN HEADER
   ===================================================== */
.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: 0.5rem;
}

.login-header p {
  font-size: 0.9375rem;
  color: var(--neutral-600);
  font-weight: 400;
}

/* =====================================================
   ALERT MESSAGES
   ===================================================== */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  border: none;
  animation: slideInDown 0.4s ease;
}

.alert i {
  font-size: 1.125rem;
}

.alert-danger {
  background-color: #fee;
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   FORM STYLES
   ===================================================== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-700);
  letter-spacing: 0.01em;
}

.form-label i {
  font-size: 1rem;
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--neutral-800);
  background-color: var(--neutral-50);
  border: 2px solid var(--neutral-200);
  border-radius: 10px;
  transition: all 0.3s ease;
  outline: none;
}

.form-control::placeholder {
  color: var(--neutral-500);
}

.form-control:hover {
  border-color: var(--neutral-300);
  background-color: white;
}

.form-control:focus {
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 4px rgba(107, 90, 74, 0.1);
}

/* =====================================================
   SUBMIT BUTTON
   ===================================================== */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.03em;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(107, 90, 74, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(107, 90, 74, 0.2);
}

.btn-primary i {
  font-size: 1.125rem;
  transition: transform 0.3s ease;
}

.btn-primary:hover i {
  transform: translateX(4px);
}

/* =====================================================
   FOOTER
   ===================================================== */
.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--neutral-200);
  text-align: center;
}

.login-footer small {
  font-size: 0.75rem;
  color: var(--neutral-500);
  font-weight: 400;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

/* Tablet - Equal Split (1:1) */
@media (max-width: 1024px) {
  .login-wrapper {
    grid-template-columns: 1fr 1fr;
  }

  .animated-text {
    font-size: 4rem;
  }

  .feature-icons {
    gap: 1.5rem;
  }

  .feature-icon i {
    font-size: 2rem;
  }
}

/* Mobile - Stacked Layout */
@media (max-width: 768px) {
  /* CRITICAL: Allow scrolling on mobile devices */
  body.login-page {
    overflow: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }

  .login-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: auto; /* Allow content to flow naturally */
  }

  .brand-panel {
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .brand-content {
    max-width: 100%;
  }

  .brand-logo {
    margin-bottom: 2rem;
  }

  .logo-svg {
    max-width: 180px;
  }

  .animated-text {
    font-size: 3rem;
  }

  .brand-tagline {
    font-size: 0.9375rem;
  }

  .brand-title {
    margin-bottom: 2rem;
  }

  .feature-icons {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    max-width: 300px;
  }

  .feature-icon i {
    font-size: 1.75rem;
  }

  .feature-icon span {
    font-size: 0.8125rem;
  }

  .form-panel {
    padding: 2rem 1.5rem;
  }

  .form-container {
    max-width: 100%;
  }

  .login-header h2 {
    font-size: 1.75rem;
  }

  .login-header p {
    font-size: 0.875rem;
  }

  /* Reduce floating shapes on mobile */
  .shape {
    opacity: 0.04;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  /* Ensure scrolling is enabled */
  body.login-page {
    overflow: auto;
    overflow-x: hidden;
  }

  .brand-panel {
    padding: 1.5rem 1rem;
  }

  .animated-text {
    font-size: 2.5rem;
  }

  .brand-tagline {
    font-size: 0.875rem;
  }

  .feature-icons {
    gap: 1rem;
  }

  .feature-icon i {
    font-size: 1.5rem;
  }

  .form-panel {
    padding: 1.5rem 1rem;
  }

  .login-header {
    margin-bottom: 2rem;
  }

  .login-header h2 {
    font-size: 1.5rem;
  }

  .form-control {
    padding: 0.75rem 0.875rem;
    font-size: 0.9375rem;
  }

  .btn-primary {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }
}

/* Large Desktop - Wider Split */
@media (min-width: 1400px) {
  .animated-text {
    font-size: 6rem;
  }

  .brand-tagline {
    font-size: 1.25rem;
  }

  .feature-icons {
    max-width: 700px;
    gap: 2.5rem;
  }

  .feature-icon i {
    font-size: 3rem;
  }

  .feature-icon span {
    font-size: 1rem;
  }

  .form-container {
    max-width: 460px;
  }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
  .login-wrapper {
    display: none;
  }
}
