/**
 * login.css — AIShala Login Page · Responsive Enhancement
 * =======================================================================
 * Depends on: style.css (design tokens)
 *
 * Key responsive changes:
 *  • Mobile (< 768px): full-width single-column, image panel hidden
 *  • Tablet (768–1023px): narrow form panel, still single column
 *  • Desktop (1024px+): two-panel split layout restored
 *  • Fluid padding, font sizes, button heights
 *  • Login card max-width prevents over-stretch on 4K
 * =======================================================================
 */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  min-height: 100vh;
  /* Allow scrolling on small screens if content overflows */
  overflow-x: hidden;
}

/* ─── LOGIN PAGE WRAPPER ─────────────────────────────────────────────── */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: url('../images/login-bg1.png') no-repeat center center;
  background-size: cover;
}
@media (max-width: 767px) {
  .login-page {
    background-image: url('../images/mobile-bg.png');
    background-position: center top;
  }
}

/* ─── FORM PANEL ─────────────────────────────────────────────────────── */
/*
 * Mobile-first: full width, centred.
 * 768px+: fixed width at left.
 * 1024px+: 48% width (original design).
 */
.login-form-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fluid padding: snug on phones, comfortable on desktop */
  padding: clamp(28px, 6vw, 56px) clamp(16px, 6vw, 52px);
  min-height: 100vh;
}

@media (min-width: 768px) {
  .login-form-panel {
    width: clamp(380px, 45%, 560px);
    min-height: 100vh;
  }
}

@media (min-width: 1024px) {
  .login-form-panel {
    width: 48%;
    max-width: 580px;
  }
}

/* ─── IMAGE PANEL ────────────────────────────────────────────────────── */
/* Hidden on mobile/tablet, visible on desktop */
.login-image-panel {
  display: none;
  position: relative;
  z-index: 1;
  flex: 1;
  align-items: flex-end;
  justify-content: flex-end;
}

@media (min-width: 1024px) {
  .login-image-panel {
    display: flex;
    height: 100vh;
    position: sticky;
    top: 0;
  }
}

.login-image-panel img {
  max-height: 100vh;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ─── LOGIN CARD ─────────────────────────────────────────────────────── */
.login-card {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(85, 176, 251, 0.8);
  border-radius: clamp(14px, 2.5vw, 22px);
  /* Fluid padding */
  padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 44px);
  width: 100%;
  max-width: min(460px, 100%);
}

/* ─── BRAND LOGO ─────────────────────────────────────────────────────── */
.card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(20px, 3.5vw, 30px);
}

.card-brand-logo {
  height: clamp(36px, 6vw, 48px);
  width: auto;
  display: block;
  object-fit: contain;
}

/* ─── HEADINGS ───────────────────────────────────────────────────────── */
.login-title {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  color: #444;
  margin-bottom: clamp(20px, 3.5vw, 30px);
}

/* ─── ALERTS ─────────────────────────────────────────────────────────── */
.success-alert,
.error-alert,
.lockout-alert {
  border-radius: 10px;
  padding: clamp(10px, 2vw, 13px) clamp(12px, 2vw, 16px);
  font-size: clamp(0.8125rem, 1.5vw, 0.875rem);
  margin-bottom: clamp(14px, 2.5vw, 20px);
}

.success-alert {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.error-alert {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lockout-alert {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* ─── INPUT GROUP ────────────────────────────────────────────────────── */
.input-group {
  position: relative;
  width: 100%;
  margin-bottom: clamp(12px, 2vw, 17px);
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
  z-index: 1;
}

/* Login-specific form-input (overrides global, keeps glass look) */
.login-card .form-input {
  width: 100%;
  height: clamp(46px, 7vw, 52px);
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  color: #1a1a2e;
  min-height: unset;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-card .form-input.input-with-icon {
  padding: 0 48px 0 44px;
}

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

.login-card .form-input:focus {
  border-color: #5baee8;
  box-shadow: 0 0 0 3px rgba(91, 174, 232, 0.25);
  background: #ffffff;
}

/* ─── PASSWORD TOGGLE ────────────────────────────────────────────────── */
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  padding: 0;
  z-index: 2;
  min-width: 32px;
  min-height: 32px;
  justify-content: center;
}

.password-toggle:hover { color: #374151; }

/* ─── REMEMBER ROW ───────────────────────────────────────────────────── */
.remember-row {
  display: flex;
  align-items: center;
  margin-bottom: clamp(18px, 3.5vw, 26px);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.8125rem, 1.5vw, 0.875rem);
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #5baee8;
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── SUBMIT BUTTON ──────────────────────────────────────────────────── */
.login-submit {
  width: 100%;
  height: clamp(48px, 8vw, 56px);
  background: linear-gradient(135deg, #f69f25, #f8b84e);
  border: none;
  border-radius: 10px;
  color: #ffffff !important;
  font-family: 'Roboto', sans-serif;
  font-size: clamp(0.9375rem, 2vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.3px;
  transition: opacity 0.2s, transform 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.login-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

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

/* ─── 4K / ULTRA-WIDE ────────────────────────────────────────────────── */
@media (min-width: 2560px) {
  .login-card {
    max-width: 520px;
    padding: 60px 52px;
  }

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