/* ═══════════════════════════════════════════════════════════════
   AI Munim — Premium Login UI
   Modern glassmorphism + animated gradient + micro-interactions
   ═══════════════════════════════════════════════════════════════ */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.modern-login {
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1a1a2e;
  overflow: hidden;
}

/* === Full-screen Shell === */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  position: relative;
}

/* ═══════════════════════════
   LEFT — Animated Showcase
   ═══════════════════════════ */
.login-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 60px;
  color: #fff;
  background: linear-gradient(135deg, #0f0c29 0%, #1a1740 30%, #302b63 60%, #24243e 100%);
  overflow: hidden;
}

/* Animated mesh gradient overlay */
.login-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 600px at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 20%, rgba(79, 209, 197, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 60% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
  animation: meshShift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes meshShift {
  0%   { transform: scale(1) translate(0, 0); opacity: 0.8; }
  50%  { transform: scale(1.1) translate(20px, -15px); opacity: 1; }
  100% { transform: scale(1) translate(-10px, 10px); opacity: 0.9; }
}

/* Dot pattern */
.login-showcase::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  pointer-events: none;
}

/* Glow orbs */
.login-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}
.glow-one {
  width: 500px; height: 500px;
  right: -120px; top: -100px;
  background: radial-gradient(circle, rgba(99,102,241,0.4) 0%, transparent 70%);
  animation: orb1 8s ease-in-out infinite alternate;
}
.glow-two {
  width: 380px; height: 380px;
  left: -100px; bottom: -50px;
  background: radial-gradient(circle, rgba(52,211,153,0.3) 0%, transparent 70%);
  animation: orb2 10s ease-in-out infinite alternate;
}
.glow-three {
  width: 250px; height: 250px;
  left: 40%; top: 30%;
  background: radial-gradient(circle, rgba(168,85,247,0.2) 0%, transparent 70%);
  animation: orb3 7s ease-in-out infinite alternate;
}
@keyframes orb1 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-30px,20px) scale(1.15); } }
@keyframes orb2 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(25px,-30px) scale(1.1); } }
@keyframes orb3 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-15px,25px) scale(0.9); } }

/* Floating particles */
.login-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-particles span {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  animation: particleFloat linear infinite;
}
.login-particles span:nth-child(1) { left: 10%; animation-duration: 18s; animation-delay: 0s; width: 3px; height: 3px; }
.login-particles span:nth-child(2) { left: 25%; animation-duration: 22s; animation-delay: 2s; width: 5px; height: 5px; opacity: 0.3; }
.login-particles span:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: 4s; }
.login-particles span:nth-child(4) { left: 55%; animation-duration: 20s; animation-delay: 1s; width: 6px; height: 6px; opacity: 0.2; }
.login-particles span:nth-child(5) { left: 70%; animation-duration: 24s; animation-delay: 3s; width: 3px; height: 3px; }
.login-particles span:nth-child(6) { left: 85%; animation-duration: 19s; animation-delay: 5s; }
.login-particles span:nth-child(7) { left: 50%; animation-duration: 21s; animation-delay: 2.5s; width: 2px; height: 2px; opacity: 0.4; }
.login-particles span:nth-child(8) { left: 15%; animation-duration: 17s; animation-delay: 6s; width: 5px; height: 5px; opacity: 0.15; }

@keyframes particleFloat {
  0%   { bottom: -10px; opacity: 0; transform: translateX(0); }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { bottom: 110%; opacity: 0; transform: translateX(80px); }
}

/* Brand */
.login-brand, .mobile-login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-logo {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 32px rgba(99,102,241,0.35);
  border: 1.5px solid rgba(255,255,255,0.2);
  letter-spacing: -0.5px;
}
.login-brand > span:last-child, .mobile-login-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.login-brand b { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.login-brand small { color: rgba(199,198,230,0.8); font-size: 11px; font-weight: 500; }

/* Hero content */
.login-hero {
  position: relative;
  z-index: 2;
  margin: auto 0;
  max-width: 620px;
}

.login-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  color: #c7c5e4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.login-pill i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px rgba(52,211,153,0.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 12px rgba(52,211,153,0.5); } 50% { box-shadow: 0 0 20px rgba(52,211,153,0.8); } }

.login-hero h1 {
  margin: 28px 0 20px;
  font-size: clamp(40px, 4.5vw, 64px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2.5px;
}
.login-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #a5b4fc, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-hero > p {
  max-width: 500px;
  color: rgba(200,198,226,0.85);
  font-size: 15px;
  line-height: 1.7;
}

/* Feature cards */
.login-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
  max-width: 580px;
}
.login-feature-grid > div {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}
.login-feature-grid > div:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.login-feature-grid .feat-icon {
  width: 42px; height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: #34d399;
  font-size: 18px;
  font-weight: 800;
}
.login-feature-grid .feat-text b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}
.login-feature-grid .feat-text small {
  color: rgba(170,168,202,0.8);
  font-size: 11px;
  line-height: 1.4;
}

/* Footer */
.login-showcase-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: rgba(145,143,181,0.7);
  font-size: 11px;
}

/* ═══════════════════════════
   RIGHT — Login Panel
   ═══════════════════════════ */
.login-panel {
  display: grid;
  place-items: center;
  padding: 48px;
  background: #f8f9fc;
  position: relative;
  overflow: hidden;
}

/* Subtle background accent */
.login-panel::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  right: -100px; top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.login-panel::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  left: -80px; bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,153,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.login-card-wrap {
  width: min(440px, 100%);
  position: relative;
  z-index: 1;
}

.mobile-login-brand {
  display: none;
  margin-bottom: 32px;
  color: #1a1a2e;
}
.mobile-login-brand small { color: #6b7280; }

/* ═══ Login Card ═══ */
.modern-login-card {
  padding: 44px;
  border: 1px solid rgba(226,228,239,0.8);
  border-radius: 28px;
  background: rgba(255,255,255,0.85);
  box-shadow:
    0 4px 6px rgba(0,0,0,0.02),
    0 24px 70px rgba(42,39,86,0.08);
  backdrop-filter: blur(20px);
  animation: cardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardEntry {
  0% { opacity: 0; transform: translateY(25px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Heading */
.login-heading > span {
  display: inline-block;
  color: #6366f1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.login-heading h2 {
  margin: 8px 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #111827;
}
.login-heading p {
  margin: 0 0 30px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

/* Error alert */
.modern-login-card .alert {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: shakeIn 0.4s ease;
}
.modern-login-card .alert::before {
  content: '⚠';
  font-size: 16px;
}
@keyframes shakeIn {
  0% { transform: translateX(-8px); opacity: 0; }
  25% { transform: translateX(6px); }
  50% { transform: translateX(-4px); }
  75% { transform: translateX(2px); }
  100% { transform: translateX(0); opacity: 1; }
}
.modern-login-card .hidden { display: none !important; }

/* ═══ Input Fields ═══ */
.login-field {
  display: block;
  margin-bottom: 20px;
}
.login-field > span {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.login-field > div {
  height: 52px;
  display: flex;
  align-items: center;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  background: #fafbff;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.login-field > div:focus-within {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.08);
}
.login-field > div:hover:not(:focus-within) {
  border-color: #c7d2fe;
}
.login-field i {
  width: 48px;
  text-align: center;
  color: #9ca3af;
  font-style: normal;
  font-size: 16px;
  transition: color 0.2s;
}
.login-field > div:focus-within i {
  color: #6366f1;
}
.login-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #111827;
}
.login-field input::placeholder {
  color: #9ca3af;
}
.login-field button {
  height: 100%;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: #6366f1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  white-space: nowrap;
}
.login-field button:hover {
  color: #4f46e5;
}

/* Options row */
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 24px;
  color: #6b7280;
  font-size: 12px;
}
.login-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.login-options input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #6366f1;
  border-radius: 4px;
  cursor: pointer;
}
.login-options > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #059669;
  font-weight: 600;
  font-size: 11px;
}
.login-options > span::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52,211,153,0.4);
}

/* ═══ Submit Button ═══ */
.login-submit {
  width: 100%;
  height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
  background-size: 200% 200%;
  color: #fff;
  font: 700 14px 'Inter', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(99,102,241,0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.login-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(99,102,241,0.4);
  background-position: right center;
}
.login-submit:hover::before {
  transform: translateX(100%);
}
.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 6px 20px rgba(99,102,241,0.3);
}
.login-submit b {
  font-size: 18px;
  transition: transform 0.3s ease;
}
.login-submit:hover b {
  transform: translateX(4px);
}
.login-submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none !important;
}

/* Loading spinner on submit */
.login-submit.loading span { visibility: hidden; }
.login-submit.loading b { visibility: hidden; }
.login-submit.loading::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Security note */
.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: #9ca3af;
  font-size: 11px;
}
.login-security span {
  font-size: 14px;
  color: #34d399;
}
.login-security p { margin: 0; }

/* ═══════════════════════════
   Responsive Design
   ═══════════════════════════ */
@media (max-width: 1100px) {
  .login-hero h1 { font-size: clamp(36px, 4vw, 52px); }
  .login-showcase { padding: 36px 40px; }
  .login-feature-grid { gap: 10px; }
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .login-panel {
    min-height: 100vh;
    padding: 32px 24px;
    background: linear-gradient(180deg, #f0f0ff 0%, #f8f9fc 50%, #f0fdf4 100%);
  }
  .mobile-login-brand { display: flex; }
  .modern-login-card { padding: 36px; }
}

@media (max-width: 520px) {
  .login-panel { padding: 20px 16px; }
  .modern-login-card {
    padding: 28px 22px;
    border-radius: 22px;
  }
  .login-heading h2 { font-size: 24px; }
  .mobile-login-brand { margin-bottom: 24px; }
  .login-card-wrap { max-width: 400px; }
  .login-submit { height: 50px; font-size: 13px; }
  .login-field > div { height: 48px; }
}

@media (max-width: 380px) {
  .modern-login-card { padding: 24px 18px; border-radius: 20px; }
  .login-heading h2 { font-size: 22px; }
  .login-heading p { font-size: 12px; }
}
