/* =====================================================
   LOGIN PAGE — Split-screen responsive layout
   ===================================================== */

/* Reset */
.login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow-x: hidden;
}

html[data-theme="dark"] .login-body {
  background: #0b1120;
}

/* Theme toggle */
.login-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

html[data-theme="dark"] .login-theme-toggle {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.login-theme-toggle:hover {
  background: rgba(255, 255, 255, 1);
}

/* =====================================================
   DESKTOP: Split-screen layout (side by side)
   ===================================================== */
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left panel — image slider */
.login-visual {
  position: relative;
  overflow: hidden;
  background: #1a3a2a;
}

.login-slider {
  position: absolute;
  inset: 0;
}

.login-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.login-slide.active {
  opacity: 1;
}

.login-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.35) 100%
  );
  z-index: 1;
}

.login-visual-brand {
  position: absolute;
  bottom: 2.5rem;
  left: 2.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-visual-icon {
  color: #fff;
  margin-bottom: 0.25rem;
}

.login-visual-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.login-visual-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}

.login-visual-company {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.01em;
}

/* Right panel — login form */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff;
}

html[data-theme="dark"] .login-form-panel {
  background: #111827;
}

.login-form-wrapper {
  width: 100%;
  max-width: 380px;
}

/* Brand in form panel */
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  text-decoration: none;
  color: inherit;
}

.login-brand-icon {
  color: #16a34a;
}

.login-brand-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

html[data-theme="dark"] .login-brand-text {
  color: #f1f5f9;
}

/* Form header */
.login-header {
  margin-bottom: 1.5rem;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .login-title {
  color: #f1f5f9;
}

.login-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

/* Form inputs */
.login-input {
  height: 44px;
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

/* Submit button */
.login-btn {
  width: 100%;
  height: 46px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  background: #16a34a;
  border-color: #16a34a;
  margin-top: 0.5rem;
  transition: background 0.2s, transform 0.1s;
}

.login-btn:hover {
  background: #15803d;
  border-color: #15803d;
}

.login-btn:active {
  transform: scale(0.99);
}

/* Footer */
.login-footer {
  margin-top: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.78rem;
}

/* =====================================================
   TABLET: Narrower split (768px–991px)
   ===================================================== */
@media (max-width: 991.98px) {
  .login-layout {
    grid-template-columns: 45% 55%;
  }

  .login-visual-brand {
    bottom: 2rem;
    left: 2rem;
  }

  .login-visual-title {
    font-size: 1.35rem;
  }

  .login-visual-sub {
    font-size: 0.78rem;
  }

  .login-form-wrapper {
    max-width: 340px;
  }

  .login-title {
    font-size: 1.4rem;
  }
}

/* =====================================================
   MOBILE: Stacked layout (image on top, form below)
   ===================================================== */
@media (max-width: 767.98px) {
  .login-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Image slider — compact top section */
  .login-visual {
    height: 180px;
    min-height: 140px;
    max-height: 220px;
  }

  .login-visual-brand {
    bottom: 1.25rem;
    left: 1.25rem;
    gap: 0.2rem;
  }

  .login-visual-icon {
    display: none;
  }

  .login-visual-title {
    font-size: 1.2rem;
  }

  .login-visual-sub {
    font-size: 0.72rem;
  }

  /* Form panel */
  .login-form-panel {
    padding: 1.5rem 1.25rem;
    align-items: flex-start;
    padding-top: 1.75rem;
  }

  .login-form-wrapper {
    max-width: 100%;
  }

  .login-brand {
    margin-bottom: 1.25rem;
  }

  .login-title {
    font-size: 1.3rem;
  }

  .login-input {
    height: 44px;
  }

  .login-btn {
    height: 46px;
  }
}

/* Small phones (< 400px) */
@media (max-width: 399.98px) {
  .login-visual {
    height: 140px;
    min-height: 120px;
  }

  .login-visual-title {
    font-size: 1.05rem;
  }

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

  .login-title {
    font-size: 1.15rem;
  }
}

/* =====================================================
   DARK MODE adjustments
   ===================================================== */
html[data-theme="dark"] .login-visual {
  background: #0a1a10;
}

html[data-theme="dark"] .login-visual-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

html[data-theme="dark"] .login-input {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

html[data-theme="dark"] .login-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

html[data-theme="dark"] .login-btn {
  background: #22c55e;
  border-color: #22c55e;
}

html[data-theme="dark"] .login-btn:hover {
  background: #16a34a;
  border-color: #16a34a;
}

html[data-theme="dark"] .form-label {
  color: #cbd5e1;
}

html[data-theme="dark"] .login-footer {
  color: #64748b;
}

html[data-theme="dark"] .alert-info {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
