:root {
    --bg: #F4F6FA;
    --surface: #FFFFFF;
    --primary: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-dark: #3730A3;
    --accent-green: #10B981;
    --accent-green-light: #ECFDF5;
    --accent-orange: #F59E0B;
    --accent-red: #EF4444;
    --accent-blue: #3B82F6;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --transition: all 0.25s ease;
    --spring: cubic-bezier(0.34,1.56,0.64,1);
  }

  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  html { height: 100%; }

  body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #000;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
  }

  /* ═══════════════════════════════
     LEFT PANEL
  ═══════════════════════════════ */
  .left-panel {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 52px;
    background: #000;
    overflow: hidden;
    flex-shrink: 0;
  }

  /* Canvas for particles */
  #bgCanvas {
    position: absolute;
    inset: 0;
        z-index: 0;
    width: 100%;
    height: 100%;
    opacity: 04;
  }

  .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
    animation: floatOrb 9s ease-in-out infinite;
  }
  .orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #4F46E5 0%, #7C3AED 60%, transparent 100%);
    top: -150px; left: -130px;
    animation-delay: 0s;
  }
  .orb-2 {
    width: 380px; height: 380px;
    background: radial-gradient(circle, #06B6D4 0%, #3B82F6 60%, transparent 100%);
    bottom: -100px; right: -80px;
    animation-delay: -3.5s;
  }
  .orb-3 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, #10B981 0%, #059669 60%, transparent 100%);
    top: 42%; left: 46%;
    transform: translate(-50%,-50%);
    animation-delay: -6s;
  }
  @keyframes floatOrb {
    0%,100% { transform: translateY(0) scale(1); }
    50%     { transform: translateY(-22px) scale(1.05); }
  }
  .orb-3 { animation-name: floatOrb3; }
  @keyframes floatOrb3 {
    0%,100% { transform: translate(-50%,-50%) scale(1); }
    50%     { transform: translate(-50%,-50%) translateY(-20px) scale(1.05); }
  }

  .grid-overlay {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none; z-index: 1;
  }

  /* ── Brand ── */
  .left-brand {
    position: relative; z-index: 3;
    opacity: 0;
    animation: fadeSlideDown 0.6s ease 0.1s forwards;
  }
  .left-brand img {
    height: 84px;
    width: auto;
    filter: brightness(0) invert(1);
    object-fit: contain;
    display: block;
    margin-bottom: 50px;
  }
  .brand-fallback {
    display: none; align-items: center; gap: 12px;
  }
  .brand-fallback.show { display: flex; }
  .brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 800; font-size: 18px;
  }
  .brand-name { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
  .brand-sub  { font-size: 11px; color: rgba(255,255,255,0.35); }

  /* ── Hero ── */
  .left-hero {
    position: relative; z-index: 3;
    opacity: 0;
    animation: fadeSlideUp 0.7s ease 0.3s forwards;
  }

  .ai-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(12px);
    color: #C7D2FE;
    font-size: 12px; font-weight: 600;
    padding: 6px 14px; border-radius: 40px;
    letter-spacing: 0.4px; margin-bottom: 28px;
  }
  .pulse-dot {
    width: 8px; height: 8px;
    background: #10B981; border-radius: 50%;
    position: relative;
  }
  .pulse-dot::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 50%;
    background: rgba(16,185,129,0.35);
    animation: pulseRing 2s ease-in-out infinite;
  }
  @keyframes pulseRing {
    0%,100% { transform: scale(1); opacity: 1; }
    50%     { transform: scale(1.8); opacity: 0; }
  }

  .left-hero h1 {
    font-size: 48px; font-weight: 800;
    color: #fff; line-height: 1.1;
    letter-spacing: -1.5px; margin-bottom: 20px;
  }
  .gradient-word {
    background: linear-gradient(135deg, #818CF8 0%, #38BDF8 50%, #34D399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200%;
    animation: shimmer 5s linear infinite;
  }
  @keyframes shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
  }

  .left-hero p {
    font-size: 15px;
    color: rgba(255,255,255,0.50);
    line-height: 1.78; max-width: 390px;
    margin-bottom: 36px;
  }

  .feature-pills { display: flex; flex-direction: column; gap: 10px; }
  .feature-pill {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    padding: 11px 16px; border-radius: 12px;
    color: rgba(255,255,255,0.68);
    font-size: 13px; font-weight: 500;
    width: fit-content;
    transition: var(--transition); cursor: default;
  }
  .feature-pill:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.18);
    color: #fff; transform: translateX(4px);
  }
  .pill-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    transition: transform 0.2s;
  }
  .feature-pill:hover .pill-icon { transform: scale(1.12); }
  .pill-icon.purple { background: rgba(99,102,241,0.22); color: #818CF8; }
  .pill-icon.cyan   { background: rgba(6,182,212,0.18);  color: #22D3EE; }
  .pill-icon.green  { background: rgba(16,185,129,0.18); color: #34D399; }
  .pill-icon.amber  { background: rgba(245,158,11,0.18); color: #FBBF24; }

  /* ── Stats ── */
  .stats-float {
    position: relative; z-index: 3;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 16px;
    padding: 18px 22px;
    display: flex; gap: 0;
    overflow: hidden;
    opacity: 0;
    animation: fadeSlideUp 0.7s ease 0.55s forwards;
    max-width:450px;
  }
  .float-stat {
    flex: 1; text-align: center; padding: 4px 8px;
    position: relative; transition: background 0.2s;
  }
  .float-stat:hover { background: rgba(255,255,255,0.04); border-radius: 10px; }
  .float-stat + .float-stat::before {
    content: '';
    position: absolute; left: 0; top: 15%; bottom: 15%;
    width: 1px; background: rgba(255,255,255,0.09);
  }
  .float-stat-value {
    font-size: 20px; font-weight: 800;
    color: #fff; letter-spacing: -0.5px; line-height: 1;
    margin-bottom: 4px;
  }
  .float-stat-label {
    font-size: 10.5px;
    color: rgba(255,255,255,0.38);
    font-weight: 500;
  }

  /* ═══════════════════════════════
     RIGHT PANEL
  ═══════════════════════════════ */
  .right-panel {
    flex: 1;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 44px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .right-panel::-webkit-scrollbar { width: 4px; }
  .right-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  /* soft tint */
  .right-panel::before {
    content: '';
    position: fixed; top: -80px; right: -80px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(79,70,229,0.055) 0%, transparent 65%);
    pointer-events: none; z-index: 0;
  }

  /* ── Login card ── */
  .login-card {
    width: 100%; max-width: 430px;
    position: relative; z-index: 1;
    opacity: 0;
    animation: fadeSlideUp 0.65s ease 0.2s forwards;
  }

  /* ── View switcher ── */
  .view-signin  { display: block; }
  .view-signup  { display: none;  }
  .view-forgot  { display: none;  }

  /* ── Card header ── */
  .login-card-header { margin-bottom: 26px; }
  .welcome-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(79,70,229,0.15);
    padding: 4px 12px; border-radius: 40px;
    margin-bottom: 13px;
  }
  .login-card-header h2 {
    font-size: 26px; font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.6px; line-height: 1.22;
    margin-bottom: 7px;
  }
  .login-card-header p {
    font-size: 13.5px;
    color: var(--text-muted); line-height: 1.65;
  }

  /* ── AI greeting ── */
  .ai-greeting {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 13px 15px;
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 24px;
    position: relative; overflow: hidden;
  }
  .ai-greeting-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px; flex-shrink: 0;
  }
  .ai-label {
    font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--primary); margin-bottom: 3px;
  }
  .ai-greeting-text p {
    font-size: 12.5px;
    color: var(--text-secondary); line-height: 1.55;
    transition: opacity 0.3s, transform 0.3s;
  }
  .ai-greeting-text p strong { color: var(--text-primary); }
  .typing-cursor {
    display: inline-block; width: 2px; height: 12px;
    background: var(--primary); border-radius: 1px;
    margin-left: 2px; vertical-align: middle;
    animation: blink 1s step-end infinite;
  }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

  /* ── Form elements ── */
  .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
  .form-group { margin-bottom: 16px; }
  .form-label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--text-primary); margin-bottom: 6px;
  }
  .input-wrap { position: relative; display: flex; align-items: center; }
  .input-icon {
    position: absolute; left: 13px;
    color: var(--text-muted); font-size: 13px;
    pointer-events: none; transition: color 0.2s; z-index: 1;
  }
  .form-input {
    width: 100%; height: 46px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 42px 0 40px;
    font-size: 13.5px; font-family: inherit;
    color: var(--text-primary); outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
  }
  .form-input::placeholder { color: var(--text-muted); font-size: 13px; }
  .form-input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px #4f46e51a;
  }
  .input-wrap:focus-within .input-icon { color: var(--primary); }
  .form-input.valid   { border-color: var(--accent-green); background: var(--surface); }
  .form-input.invalid { border-color: var(--accent-red); background: #FFF8F8; }

  select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239CA3AF' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 32px;
    background-color: #fff;
  }
  select.form-input option { background: var(--surface); color: var(--text-primary); }

  .toggle-password {
    position: absolute; right: 12px;
    background: none; border: none;
    cursor: pointer; color: var(--text-muted);
    font-size: 13px; padding: 4px;
    transition: color 0.2s; z-index: 1;
  }
  .toggle-password:hover { color: var(--primary); }

  /* Strength bar */
  .pwd-strength { display: none; margin-top: 7px; }
  .pwd-strength.show { display: block; }
  .strength-track {
    height: 3px; background: var(--border);
    border-radius: 3px; overflow: hidden; margin-bottom: 4px;
  }
  .strength-fill {
    height: 100%; border-radius: 3px;
    transition: width 0.4s ease, background 0.4s; width: 0;
  }
  .strength-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }

  /* Error */
  .form-error {
    font-size: 11.5px; color: var(--accent-red);
    margin-top: 5px; display: none;
    align-items: center; gap: 4px;
  }
  .form-error.show {
    display: flex;
    animation: errShake 0.28s ease;
  }
  @keyframes errShake {
    0%{transform:translateX(-5px)} 50%{transform:translateX(3px)} 100%{transform:translateX(0)}
  }

  /* Options row */
  .form-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; margin-top: -3px;
  }
  .checkbox-label {
    display: flex; align-items: center; gap: 7px;
    cursor: pointer; font-size: 12.5px;
    color: var(--text-secondary); font-weight: 500;
  }
  .checkbox-label input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--primary); cursor: pointer;
  }
  .forgot-link {
    font-size: 12.5px; font-weight: 600; color: var(--primary);
    text-decoration: none; cursor: pointer; transition: color 0.2s;
  }
  .forgot-link:hover { color: var(--primary-dark); text-decoration: underline; }

  /* Terms */
  .terms-row {
    display: flex; align-items: flex-start; gap: 8px;
    margin-bottom: 16px; margin-top: -3px;
  }
  .terms-row input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--primary); cursor: pointer;
    margin-top: 2px; flex-shrink: 0;
  }
  .terms-row label {
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.65; cursor: pointer;
  }
  .terms-row label a { color: var(--primary); font-weight: 600; text-decoration: none; }
  .terms-row label a:hover { text-decoration: underline; }

  /* ── Primary button ── */
  .btn-login {
    width: 100%; height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
    color: white; border: none;
    border-radius: var(--radius-sm);
    font-size: 14.5px; font-weight: 700; font-family: inherit;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: var(--transition);
    position: relative; overflow: hidden;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 18px rgba(79,70,229,0.30);
    margin-bottom: 0;
  }
  .btn-login::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0; transition: opacity 0.2s;
  }
  .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(79,70,229,0.40);
  }
  .btn-login:hover::before { opacity: 1; }
  .btn-login:active { transform: translateY(0); }
  .btn-arrow {
    width: 24px; height: 24px;
    background: rgba(255,255,255,0.18);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; flex-shrink: 0;
    transition: transform 0.2s;
  }
  .btn-login:hover .btn-arrow { transform: translateX(4px); }

  /* ── Divider ── */
  .divider {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0;
  }
  .divider-line { flex: 1; height: 1px; background: var(--border-light); }
  .divider span { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }

  /* ── SSO buttons ── */
  .sso-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .sso-btn {
    height: 44px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer; transition: var(--transition); font-family: inherit;
  }
  .sso-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
  }

  /* ── Signup CTA block ── */
  .signup-cta-block {
    margin-top: 22px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .signup-cta-block:hover {
    border-color: rgba(79,70,229,0.25);
    box-shadow: 0 4px 16px rgba(79,70,229,0.07);
  }
  .signup-cta-text p {
    font-size: 13px; color: var(--text-secondary); line-height: 1.5;
  }
  .signup-cta-text p strong {
    display: block;
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 2px;
  }
  .btn-signup-cta {
    height: 40px;
    padding: 0 20px;
    background: var(--primary);
    color: white; border: none;
    border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 700; font-family: inherit;
    cursor: pointer; white-space: nowrap;
    display: flex; align-items: center; gap: 7px;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(79,70,229,0.25);
    flex-shrink: 0;
  }
  .btn-signup-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79,70,229,0.35);
  }

  /* ── Footer ── */
  .login-footer {
    margin-top: 18px;
    text-align: center;
  }
  .login-footer p { font-size: 11.5px; color: var(--text-muted); line-height: 1.7; }
  .login-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
  .login-footer a:hover { text-decoration: underline; }
  .security-note {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 10px; font-size: 11px; color: var(--text-muted); font-weight: 500;
  }
  .security-note i { color: var(--accent-green); font-size: 11px; }

  /* ── Back link ── */
  .back-link {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; margin-bottom: 20px;
    transition: color 0.2s;
    background: none; border: none; padding: 0; font-family: inherit;
  }
  .back-link:hover { color: var(--primary); }

  /* ── Toast ── */
  .toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 11px 22px;
    display: flex; align-items: center; gap: 9px;
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    box-shadow: 0 8px 28px rgba(0,0,0,0.10);
    opacity: 0; transition: all 0.35s ease;
    z-index: 9999; white-space: nowrap;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ── Animated view transitions ── */
  .view-block {
    animation: viewIn 0.38s ease forwards;
  }
  @keyframes viewIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Keyframes */
  @keyframes fadeSlideUp   { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
  @keyframes fadeSlideDown { from{opacity:0;transform:translateY(-14px)} to{opacity:1;transform:translateY(0)} }

  /* ── Responsive ── */
  @media (max-width: 980px) {
    body { overflow-y: auto; }
    .left-panel { display: none; }
    .right-panel { padding: 28px 20px; min-height: 100vh; align-items: flex-start; padding-top: 48px; }
  }
  @media (max-width: 480px) {
    .form-row-2 { grid-template-columns: 1fr; }
    .signup-cta-block { flex-direction: column; align-items: flex-start; }
    .btn-signup-cta { width: 100%; justify-content: center; }
  }
i.fas.fa-circle-exclamation {
    color: red;
}