/* ==========================================================================
   login.css
   Login page layout. Desktop: 70% brand panel / 30% form panel.
   Mobile (<992px): form panel becomes 100% width, brand panel is hidden.

   IMPORTANT: the brand panel always uses the fixed --brand-panel-* tokens
   (a solid dark green gradient), never --sidebar-bg. --sidebar-bg turns
   white in light mode for the dashboard sidebar, which used to leave the
   brand panel's white text unreadable on a white background. The form
   panel still follows the normal light/dark theme tokens.
   ========================================================================== */

body { font-family: var(--font-family); }

.app-wrapper {
  min-height: 100vh;
  background-color: var(--bg-body);
  color: var(--text-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------- */
/* Left / brand panel — 70% on desktop, hidden on mobile                   */
/* Fixed dark-green gradient, independent of the light/dark theme toggle.  */
/* ---------------------------------------------------------------------- */
.login-brand {
  flex: 0 0 70%;
  max-width: 70%;
  position: relative;
  background: linear-gradient(135deg, var(--brand-panel-from) 0%, var(--brand-panel-via) 55%, var(--brand-panel-to) 100%);
  color: #ffffff;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(34, 197, 94, 0.28), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(74, 222, 128, 0.22), transparent 45%);
  pointer-events: none;
}
.brand-logo-row { position: relative; }
.brand-title {
  position: relative;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #bbf7d0, #4ade80);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-desc {
  position: relative;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 520px;
  line-height: 1.6;
}
.brand-highlights {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 2.25rem;
}
.brand-highlights .highlight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}
.brand-highlights .highlight-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.22);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.login-brand-footer {
  position: relative;
  margin-top: 2.5rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------------- */
/* Right / form panel — 30% on desktop, 100% on mobile                     */
/* Follows the normal light/dark surface tokens.                          */
/* ---------------------------------------------------------------------- */
.login-form-panel {
  flex: 0 0 30%;
  max-width: 30%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-surface);
}
.form-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
}
.form-topbar .brand-logo-mobile img { filter: var(--logo-filter, none); }
.form-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.75rem 2.5rem;
}
.form-wrapper { max-width: 400px; width: 100%; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.icon-btn:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--green-600);
  color: var(--green-600);
}
.icon-btn .icon-sun { display: none; }
#theme-toggle:checked ~ .app-wrapper .icon-btn .icon-sun { display: inline-flex; }
#theme-toggle:checked ~ .app-wrapper .icon-btn .icon-moon { display: none; }

.lang-toggle {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.login-btn {
  background: var(--green-600);
  border: none;
  color: #fff;
  padding: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: var(--glow-button);
  transition: 0.2s;
}
.login-btn:hover {
  background: var(--green-700);
  color: #fff;
}
.login-btn:disabled { opacity: 0.7; }

.form-label { color: var(--text-primary); font-size: var(--font-size-sm); font-weight: 600; }
.form-control {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
}
.form-control:focus {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: none;
}
.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.75;
}
.input-group-text {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.input-group:focus-within {
  border-color: var(--green-600);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-sm);
}
.toggle-password { cursor: pointer; }

.form-check-input:checked {
  background-color: var(--green-600);
  border-color: var(--green-600);
}
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.2);
  border-color: var(--green-600);
}
.text-success { color: var(--green-600) !important; }
#theme-toggle:checked ~ .app-wrapper .text-success { color: var(--green-400) !important; }

.dropdown-menu {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-hover);
}
.dropdown-item { color: var(--text-primary); font-size: var(--font-size-sm); }
.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--bg-surface-hover);
  color: var(--green-600);
}
.modal-content {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------------------- */
/* Responsive: below 992px the brand panel disappears, form goes 100%      */
/* ---------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .login-brand { display: none; }
  .login-form-panel {
    flex: 0 0 100%;
    max-width: 100%;
    background-color: var(--bg-body);
  }
  .form-body { padding-top: 0.5rem; }
}

@media (max-width: 420px) {
  .form-topbar { padding: 1rem; }
  .form-body { padding: 0.5rem 1.25rem 2rem; }
}
