/* ============================================================================
   VESTA CRM — Login Screen
   Design: Dark premium, Apple-like, constellation network effect
   ============================================================================ */

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

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.15);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-primary: #f1f5f9;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);
  --bg-dark: #0a0a0f;
  --bg-card: rgba(15, 15, 25, 0.8);
  --danger: #ef4444;
  --success: #22c55e;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Canvas Background ─────────────────────────────────────────────────── */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── Ambient Glow Orbs ─────────────────────────────────────────────────── */
.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  animation: orbFloat 20s ease-in-out infinite;
}

.ambient-orb--1 {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.ambient-orb--2 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  bottom: -15%;
  left: -10%;
  animation-delay: -7s;
}

.ambient-orb--3 {
  width: 400px;
  height: 400px;
  background: #a855f7;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.06;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.03); }
}

/* ─── Main Layout ───────────────────────────────────────────────────────── */
.login-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* ─── Left Panel — Brand & Vision ───────────────────────────────────────── */
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 80px;
  position: relative;
  overflow: hidden;
}

.brand-content {
  max-width: 520px;
}

/* Logo Area */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
}

.brand-logo__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.brand-logo__icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.brand-logo__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-logo__name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-logo__holding {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Headline */
.brand-headline {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.brand-headline span {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rotating Phrases */
.brand-phrase {
  height: 28px;
  margin-bottom: 48px;
  overflow: hidden;
  position: relative;
}

.brand-phrase__text {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 28px;
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-phrase__text.active {
  opacity: 1;
  transform: translateY(0);
}

.brand-phrase__text.exit {
  opacity: 0;
  transform: translateY(-20px);
}

/* Feature Pills */
.brand-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: default;
}

.feature-pill:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.feature-pill svg {
  width: 15px;
  height: 15px;
  opacity: 0.6;
}

.feature-pill:hover svg {
  opacity: 1;
  color: var(--accent);
}

/* ─── Right Panel — Form ────────────────────────────────────────────────── */
.login-form-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 32px 64px -16px rgba(0, 0, 0, 0.5);
}

.login-card__header {
  margin-bottom: 36px;
}

.login-card__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-card__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ─── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  animation: alertSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert--success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.alert svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

/* ─── Form Fields ───────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-group__input-wrap {
  position: relative;
}

.form-group__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.form-group__input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-group__input::placeholder {
  color: var(--text-muted);
}

.form-group__input:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--surface-hover);
}

.form-group__input:focus {
  border-color: var(--border-focus);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group__input:focus ~ .form-group__icon {
  color: var(--primary-light);
}

/* Password Toggle */
.form-group__toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color var(--transition);
}

.form-group__toggle:hover {
  color: var(--text-secondary);
}

.form-group__toggle svg {
  width: 18px;
  height: 18px;
}

/* ─── Submit Button ─────────────────────────────────────────────────────── */
.btn-login {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-login:hover::before {
  opacity: 1;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.5);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login--loading span {
  opacity: 0;
}

.btn-login--loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  top: 50%;
  left: 50%;
  margin: -11px 0 0 -11px;
  z-index: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.login-card__footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.login-card__footer p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-card__footer a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.login-card__footer a:hover {
  color: var(--accent);
}

/* ─── Bottom Bar ────────────────────────────────────────────────────────── */
.login-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.login-bottom__left,
.login-bottom__right {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.login-bottom__right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-bottom__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .login-container {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-form-area {
    padding: 40px 24px;
  }

  .login-card {
    max-width: 400px;
    padding: 40px 32px;
  }

  .login-bottom {
    padding: 16px 24px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
    border-radius: var(--radius-lg);
  }

  .login-card__title {
    font-size: 20px;
  }
}

/* ─── Mobile Brand Header (shown on small screens) ──────────────────────── */
.login-card__brand-mobile {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-card__brand-mobile .brand-logo__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.login-card__brand-mobile .brand-logo__icon svg {
  width: 20px;
  height: 20px;
}

.login-card__brand-mobile .brand-logo__name {
  font-size: 16px;
}

@media (max-width: 1024px) {
  .login-card__brand-mobile {
    display: flex;
  }
}
