/* =========================================================
   LeadIntelligence AI — Auth Compact Theme (v1.0)
   Single file for register/login/forgot/reset auth screens
   ========================================================= */

/* ---- Theme tokens ---- */
:root{
  --ink:#0f172a; --muted:#48556a; --line:#e6e9ef; --card:#ffffff;
  --bg1:#6e75d7; --bg2:#6570c9; --bg3:#5b6abc;
  --primary:#6366f1; --danger:#ef4444; --success:#10b981;
  --radius:16px; --shadow-lg:0 22px 48px rgba(2,6,23,.16);
}

/* ---- Backdrop + base ---- */
html,body{height:100%; margin:0; padding:0;}
body{
  color:var(--ink);
  font:15px/1.55 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  background:linear-gradient(135deg,var(--bg1),var(--bg2) 50%,var(--bg3));
  display:flex; flex-direction:column;
}

/* Optional: hide existing app/site chrome when body has .auth-nochrome */
.auth-nochrome .site-header,
.auth-nochrome header.site-header,
.auth-nochrome .global-header,
.auth-nochrome .navbar,
.auth-nochrome .site-footer,
.auth-nochrome footer.site-footer,
.auth-nochrome .global-footer { display:none !important; }

/* ---- Header Styles ---- */
.site-header{
  position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,.9);
  backdrop-filter:saturate(140%) blur(8px);
  border-bottom:1px solid var(--line);
}
.nav{
  max-width:1200px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px;
}
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; color:var(--ink); text-decoration:none; }
.brand-badge{
  width:32px; height:32px; border-radius:8px;
  background:linear-gradient(135deg,#a78bfa,#6366f1);
  display:grid; place-items:center; color:#fff; font-size:16px;
  box-shadow:0 6px 16px rgba(99,102,241,.35)
}

/* ---- Navigation Links (Desktop) ---- */
.nav-links{ display:flex; gap:24px; align-items:center; }
.nav-links a{ color:#334155; font-weight:600; text-decoration:none; transition:color .2s; }
.nav-links a:hover{ color:var(--primary); }
.btn{ display:inline-flex; align-items:center; justify-content:center; border-radius:10px; padding:10px 20px; font-weight:700; text-decoration:none; transition:all .2s; }
.btn-plain{ color:#334155; }
.btn-primary{ background:linear-gradient(135deg,#7c83f8,#6366f1); color:#fff; box-shadow:0 8px 20px rgba(99,102,241,.35); }
.btn-primary:hover{ filter:brightness(.98); transform:translateY(-1px); }

/* ---- Mobile Menu Toggle ---- */
.mobile-menu-toggle{
  display:none;
  background:none;
  border:none;
  cursor:pointer;
  padding:8px;
  margin-left:auto;
  z-index:100;
}
.hamburger{
  display:block;
  width:24px;
  height:2px;
  background:var(--ink);
  position:relative;
  transition:background 0.2s;
}
.hamburger::before,
.hamburger::after{
  content:'';
  position:absolute;
  width:24px;
  height:2px;
  background:var(--ink);
  left:0;
  transition:transform 0.3s;
}
.hamburger::before{ top:-6px; }
.hamburger::after{ bottom:-6px; }

/* Mobile Menu Open States */
.mobile-menu-toggle.active .hamburger{
  background:transparent;
}
.mobile-menu-toggle.active .hamburger::before{
  transform:rotate(45deg) translate(4px, 4px);
}
.mobile-menu-toggle.active .hamburger::after{
  transform:rotate(-45deg) translate(4px, -4px);
}

/* ---- Mobile Navigation Overlay ---- */
.mobile-nav-overlay{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(15, 23, 42, 0.95);
  backdrop-filter:blur(8px);
  z-index:999;
  opacity:0;
  visibility:hidden;
  transition:opacity 0.3s, visibility 0.3s;
}

.mobile-nav-overlay.active{
  opacity:1;
  visibility:visible;
  display:block;
}

.mobile-nav{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:var(--card);
  padding:env(safe-area-inset-top) 20px env(safe-area-inset-bottom) 20px;
  overflow-y:auto;
  transform:translateX(-100%);
  transition:transform 0.3s ease;
}

.mobile-nav-overlay.active .mobile-nav{
  transform:translateX(0);
}

.mobile-nav-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 0;
  border-bottom:1px solid var(--line);
  margin-bottom:24px;
}

.mobile-menu-close{
  background:none;
  border:none;
  font-size:32px;
  color:var(--muted);
  cursor:pointer;
  padding:8px;
  line-height:1;
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.mobile-nav-links{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.mobile-nav-links a{
  display:block;
  padding:16px 20px;
  color:var(--ink);
  font-weight:600;
  text-decoration:none;
  border-radius:12px;
  transition:all 0.2s;
  font-size:16px;
}

.mobile-nav-links a:not(.mobile-cta):hover{
  background:rgba(99, 102, 241, 0.08);
  color:var(--primary);
}

.mobile-cta{
  margin-top:24px;
  text-align:center;
  background:linear-gradient(135deg,#7c83f8,#6366f1);
  color:#fff !important;
  box-shadow:0 8px 20px rgba(99,102,241,.35);
}

.mobile-cta:hover{
  filter:brightness(.98);
  transform:translateY(-1px);
}

/* ---- Auth layout ---- */
.auth-main{ flex:1; display:flex; align-items:center; justify-content:center; padding:40px 20px; }
.auth-container{ width:100%; max-width:1080px; margin:0 auto; }
.auth-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-lg); overflow:hidden; }
.auth-card.login,.auth-card.forgot,.auth-card.reset{ max-width:520px; margin:0 auto; }

/* ---- Card header ---- */
.auth-card-header{ padding:28px 32px; border-bottom:1px solid var(--line); background:linear-gradient(180deg,#fafbff,#ffffff); }
.auth-title{ margin:0 0 4px; font-size:22px; letter-spacing:.2px; }
.auth-subtitle{ margin:0; color:var(--muted); }
.auth-link-primary{ color:var(--primary); font-weight:700; text-decoration:none; }
.auth-link-primary:hover{ text-decoration:underline; }

/* ---- Form ---- */
.auth-form{ padding:28px 32px; }
.form-group + .form-group{ margin-top:16px; }
.form-label{ display:block; font-weight:800; margin:0 0 8px; }
.form-label-required{ color:var(--danger); margin-left:3px; }
.form-input{
  width:100%; padding:12px;
  border:1px solid #d9dee8; border-radius:12px; background:#fff; outline:none;
  transition:box-shadow .2s, border-color .2s; font-size:16px;
}
.form-input:focus{ border-color:#b4baf0; box-shadow:0 0 0 3px rgba(99,102,241,.18); }
.form-hint{ color:#6b7280; font-size:12px; margin-top:6px; }

/* Names row + account type grid */
.form-row{ display:grid; grid-template-columns:repeat(2,minmax(300px,1fr)); gap:18px; }
.account-type-grid{ display:grid; grid-template-columns:repeat(2,minmax(300px,1fr)); gap:18px; margin-top:8px; }

/* Account-type cards */
.account-type-card{
  position:relative; padding:20px 20px 20px 60px;
  border:1px solid #d9dee8; border-radius:12px; background:#fff;
  cursor:pointer; display:flex; flex-direction:column; justify-content:center;
  min-height:120px; transition:all .2s;
}
.account-type-card:hover{ border-color:#b4baf0; }
.account-type-card .account-type-icon{ position:absolute; left:20px; top:50%; transform:translateY(-50%); font-size:24px; }
.account-type-card.selected{ border-color:#6366f1; background:#f8faff; box-shadow:0 0 0 3px rgba(99,102,241,.18); }
.account-type-radio{ position:absolute; opacity:0; pointer-events:none; }
.account-type-card strong{ display:block; font-size:16px; margin-bottom:4px; }
.account-type-card small{ color:#6b7280; font-size:14px; }

/* Company section */
.company-fields{ border:1px dashed #c7cce0; border-radius:12px; padding:20px; background:#fafbff; margin-top:16px; }
.company-fields:not(.active){ display:none; }

/* Password strength */
.password-strength{ margin-top:8px; }
.strength-bar{ height:8px; background:#eef2ff; border-radius:999px; overflow:hidden; }
.strength-fill{ height:100%; width:0%; transition:width .25s ease; border-radius:inherit; }
.strength-weak{ background:#f43f5e; }
.strength-medium{ background:#f59e0b; }
.strength-strong, .strength-very-strong{ background:#10b981; }
.strength-text{ font-size:12px; color:#475569; margin-top:6px; }

/* Checkbox */
.checkbox-group{ display:flex; align-items:flex-start; gap:10px; margin:20px 0; }
.checkbox-input{ transform:scale(1.1); margin-top:2px; }
.checkbox-label{ font-size:14px; line-height:1.4; }
.checkbox-label a{ color:var(--primary); font-weight:700; text-decoration:none; }
.checkbox-label a:hover{ text-decoration:underline; }

/* Login options */
.login-options{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:16px 0 0; }
.forgot-password{ color:var(--primary); font-weight:700; text-decoration:none; white-space:nowrap; }
.forgot-password:hover{ text-decoration:underline; }

/* Alerts */
.form-error,.form-success{ margin:0 32px 20px; padding:12px 16px; border-radius:10px; font-weight:600; }
.form-error{ color:#991b1b; background:#fee2e2; border:1px solid #fecaca; }
.form-success{ color:#065f46; background:#d1fae5; border:1px solid #a7f3d0; }

/* Submit + bottom links */
.auth-button{ width:100%; padding:14px 16px; border-radius:12px; border:0; font-weight:800; color:#fff;
  background:linear-gradient(135deg,#7c83f8,#6366f1); box-shadow:0 10px 24px rgba(99,102,241,.35); cursor:pointer; font-size:16px; transition:filter .2s; }
.auth-button:hover{ filter:brightness(.98); }
.auth-links{ text-align:center; margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
.auth-text-muted{ color:#6b7280; font-size:14px; }
.auth-links a{ color:var(--primary); font-weight:700; text-decoration:none; }
.auth-links a:hover{ text-decoration:underline; }

/* ---- Footer ---- */
.auth-site-footer{ background:transparent; color:rgba(255,255,255,0.8); margin-top:auto; }
.auth-footer-wrap{ max-width:1200px; margin:0 auto; padding:40px 20px; }
.auth-footer-grid{ display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:40px; }
.auth-footer-brand{ display:flex; align-items:center; gap:10px; font-weight:800; margin-bottom:16px; }
.auth-footer-brand .auth-brand-badge{ box-shadow:none; }
.auth-footer-col h4{ margin:0 0 16px; color:#fff; font-weight:700; font-size:16px; }
.auth-footer-col a{ display:block; color:rgba(255,255,255,0.7); text-decoration:none; margin:8px 0; transition:color .2s; }
.auth-footer-col a:hover{ color:#fff; }
.auth-footer-bottom{ border-top:1px solid rgba(255,255,255,0.2); margin-top:40px; padding-top:20px;
  text-align:center; color:rgba(255,255,255,0.7); font-size:14px; }

/* === iPhone mini tuning (≤ 480px) === */
@media (max-width: 480px) {
  .site-header { 
    padding-top: env(safe-area-inset-top); 
  }
  
  body { 
    padding-bottom: env(safe-area-inset-bottom);
  }

  .nav { 
    padding:10px 14px; 
  }
  
  /* Show mobile menu button, hide desktop nav */
  .mobile-menu-toggle { 
    display:block; 
  }
  
  .nav-links { 
    display:none !important; 
  }
  
  /* Mobile navigation specific */
  .mobile-nav {
    padding:env(safe-area-inset-top) 14px env(safe-area-inset-bottom) 14px;
  }
  
  .mobile-nav-header { 
    padding:12px 0; 
    margin-bottom:20px; 
  }
  
  .mobile-nav-links a {
    padding:14px 16px;
    font-size:15px;
    min-height:44px;
    display:flex;
    align-items:center;
  }
  
  .mobile-cta {
    margin-top:20px;
    padding:14px 16px;
    font-size:15px;
    min-height:44px;
  }

  /* Prevent body scrolling when menu is open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }

  .auth-main { padding:20px 14px; }
  .auth-container { max-width:100%; }
  .auth-card { border-radius:14px; }
  .auth-card-header { padding:18px 16px; }
  .auth-form { padding:16px; }

  .form-input { font-size:16px; padding:12px; }
  .form-group + .form-group { margin-top:14px; }

  .form-row, .account-type-grid { grid-template-columns:1fr; gap:12px; }

  .account-type-card { min-height:96px; padding:16px 16px 16px 52px; }
  .account-type-card .account-type-icon { left:16px; font-size:22px; }

  .auth-button { padding:13px 14px; font-size:16px; border-radius:12px; }

  .auth-footer-wrap { padding:28px 16px; }
  .auth-footer-grid { grid-template-columns:1fr; gap:18px; }
}

/* === Tablet (481px - 1024px) === */
@media (min-width: 481px) and (max-width: 1024px) {
  .nav-links {
    gap: 16px;
  }
  
  .nav-links a:not(.btn) {
    font-size: 14px;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* === Desktop (≥ 1025px) === */
@media (min-width: 1025px) {
  /* Ensure mobile overlay is hidden on desktop */
  .mobile-nav-overlay {
    display: none !important;
  }
  
  /* Show desktop navigation */
  .nav-links {
    display: flex !important;
  }
  
  /* Hide mobile menu button */
  .mobile-menu-toggle {
    display: none;
  }
}

/* Improve touch feel */
* { 
  -webkit-tap-highlight-color: rgba(0,0,0,0.05); 
}

/* Smooth transitions for interactive elements */
a, button, .btn, .mobile-menu-toggle, .mobile-menu-close {
  transition: all 0.2s ease;
}