/* ═══════════════════════════════════════════════════════════
   ContractsIQ.ai — Brand Identity Styles
   Brand Guidelines v1.0 | February 2026
   Primary:   Deep Navy  #1a2b4a
   Accent:    Electric Blue  #0066FF
   Secondary: Slate Gray  #64748b
   Surface:   Light Gray  #f8fafc
   Card:      Pure White  #ffffff
   Font:      Inter (Google Fonts)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary:      #1a2b4a;   /* Deep Navy Blue */
  --accent:       #0066FF;   /* Electric Blue */
  --accent-dark:  #0052cc;   /* Electric Blue darker */
  --accent-light: #e6f0ff;   /* Electric Blue tint */
  --success:      #10b981;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --slate:        #64748b;   /* Slate Gray */
  --surface:      #ffffff;   /* Pure White — cards */
  --bg:           #f8fafc;   /* Light Gray — page bg */
  --text:         #1a2b4a;   /* Deep Navy — headings/text */
  --text-muted:   #64748b;   /* Slate Gray — secondary */
  --border:       #e2e8f0;
  --radius:       12px;
  --shadow:       0 1px 3px rgba(26,43,74,0.07), 0 4px 16px rgba(26,43,74,0.05);
  --shadow-lg:    0 8px 32px rgba(26,43,74,0.14);
  --sidebar-bg:   #1a2b4a;   /* Deep Navy sidebar */
  --sidebar-active: rgba(0,102,255,0.15);
  --sidebar-active-text: #4d94ff;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar { width: 260px; min-height: 100vh; background: var(--sidebar-bg); position: fixed; top: 0; left: 0; z-index: 100; display: flex; flex-direction: column; }

/* Logo area — "Contracts IQ" wordmark style */
.sidebar-logo { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo .logo-text { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.5px; line-height: 1; }
.sidebar-logo .logo-iq {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 900; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 5px; margin-left: 3px;
  vertical-align: middle; line-height: 1.4;
}
.sidebar-logo .logo-sub { font-size: 10px; color: rgba(255,255,255,0.38); text-transform: uppercase; letter-spacing: 2px; margin-top: 5px; }

.sidebar-nav { flex: 1; padding: 14px 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px;
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.sidebar-nav a.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.sidebar-nav a i { width: 18px; text-align: center; font-size: 14px; }
.sidebar-section { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.25); text-transform: uppercase; letter-spacing: 1.5px; padding: 16px 14px 6px; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.org-badge { background: rgba(255,255,255,0.06); border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.org-avatar {
  width: 32px; height: 32px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 12px; flex-shrink: 0;
}
.org-name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.org-plan { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ── Main Layout ── */
.main-content { margin-left: 260px; min-height: 100vh; }
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.page-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.page-body { padding: 28px 32px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.card-body { padding: 20px; }

/* ── Stat Tiles ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 12px; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.5px; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-card .stat-change { font-size: 11px; margin-top: 6px; font-weight: 600; }
.stat-card.danger  { border-left: 3px solid var(--danger); }
.stat-card.warning { border-left: 3px solid var(--warning); }
.stat-card.success { border-left: 3px solid var(--success); }
.stat-card.primary { border-left: 3px solid var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  border: none; text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,102,255,0.3); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed #cbd5e1; border-radius: 16px;
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-light); }
.upload-icon { font-size: 48px; color: #cbd5e1; margin-bottom: 16px; }
.upload-zone:hover .upload-icon { color: var(--accent); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; gap: 4px; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-navy   { background: var(--accent-light); color: var(--primary); }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ── Risk Flags ── */
.risk-flag { border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; border-left: 3px solid; }
.risk-flag.high   { background: #fff1f2; border-color: var(--danger); }
.risk-flag.medium { background: #fffbeb; border-color: var(--warning); }
.risk-flag.low    { background: #f0fdf4; border-color: var(--success); }
.risk-flag .risk-title { font-size: 13px; font-weight: 700; }
.risk-flag .risk-desc  { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

/* ── Health Score Ring ── */
.health-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.health-ring svg { transform: rotate(-90deg); }
.health-ring .score-text { position: absolute; font-size: 22px; font-weight: 800; font-family: 'Inter', sans-serif; }

/* ── Contract Table ── */
.contracts-table { width: 100%; border-collapse: collapse; }
.contracts-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-weight: 600;
  background: #f8fafc; border-bottom: 1px solid var(--border);
}
.contracts-table td { padding: 13px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; vertical-align: middle; }
.contracts-table tr:hover td { background: #f8fafc; }
.contracts-table tr.flagged td { background: #fff8f8; }
.vendor-cell { display: flex; align-items: center; gap: 10px; }
.vendor-avatar {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
}

/* ── Progress Bar ── */
.progress-bar { height: 5px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,43,74,0.55); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 800px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); z-index: 10; }
.modal-body { padding: 24px; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; transition: border 0.15s; font-family: 'Inter', sans-serif; color: var(--text); }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,102,255,0.08); }

/* ── Loading ── */
.spinner { width: 34px; height: 34px; border: 3px solid #e2e8f0; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.88); z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.loading-text { font-size: 15px; font-weight: 600; color: var(--text-muted); }

/* ── Charts ── */
.chart-container { position: relative; }

/* ── Timeline ── */
.timeline-item { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.timeline-date { font-size: 11px; color: var(--text-muted); min-width: 80px; }
.timeline-content { flex: 1; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 52px; color: #cbd5e1; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text); }
.empty-desc { font-size: 14px; color: var(--text-muted); margin-top: 6px; max-width: 360px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE — ContractsIQ brand dark navy theme
   ═══════════════════════════════════════════════════════════ */
.landing { background: var(--primary); min-height: 100vh; }

.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 52px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(26,43,74,0.97);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}

/* Landing logo */
.landing-logo-text { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.landing-logo-iq {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 900;
  padding: 2px 7px; border-radius: 5px; margin-left: 2px;
  vertical-align: middle;
}

.hero {
  padding: 96px 52px 80px; text-align: center;
  background: linear-gradient(180deg, #1a2b4a 0%, #0f1e35 100%);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,102,255,0.12); color: #4d94ff;
  border: 1px solid rgba(0,102,255,0.25);
  padding: 6px 16px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 28px;
}
.hero h1 {
  font-size: 54px; font-weight: 900; color: #fff;
  line-height: 1.08; letter-spacing: -2px;
  max-width: 820px; margin: 0 auto 24px;
}
.hero h1 span { color: #4d94ff; }
.hero p { font-size: 17px; color: rgba(255,255,255,0.55); max-width: 560px; margin: 0 auto 44px; line-height: 1.75; }
.hero-cta { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }

.btn-hero { padding: 14px 32px; font-size: 15px; border-radius: 8px; font-weight: 700; cursor: pointer; border: none; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.btn-hero-primary { background: var(--accent); color: #fff; }
.btn-hero-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(0,102,255,0.45); }
.btn-hero-outline { background: transparent; color: rgba(255,255,255,0.8); border: 1.5px solid rgba(255,255,255,0.2); }
.btn-hero-outline:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); }

/* Hero trust badges */
.hero-trust { margin-top: 56px; display: flex; align-items: center; justify-content: center; gap: 32px; flex-wrap: wrap; }
.hero-trust-item { font-size: 12px; color: rgba(255,255,255,0.35); font-weight: 500; letter-spacing: 0.3px; display: flex; align-items: center; gap: 6px; }
.hero-trust-item i { color: rgba(0,102,255,0.6); }

.features-section { padding: 80px 52px; background: #0f1e35; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 1100px; margin: 0 auto; }
.feature-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px; padding: 26px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: rgba(0,102,255,0.3); transform: translateY(-2px); }
.feature-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 16px; }
.feature-title { font-size: 15px; font-weight: 700; color: #e2e8f0; margin-bottom: 8px; }
.feature-desc { font-size: 13px; color: rgba(255,255,255,0.38); line-height: 1.65; }

.pricing-section { padding: 80px 52px; background: #1a2b4a; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; max-width: 1100px; margin: 0 auto; }
.pricing-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px; padding: 28px; text-align: center;
}
.pricing-card.popular { border-color: var(--accent); background: rgba(0,102,255,0.08); position: relative; }
.popular-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 4px 14px; border-radius: 99px; letter-spacing: 1px;
}
.pricing-name { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.pricing-price { font-size: 42px; font-weight: 900; color: #fff; line-height: 1; letter-spacing: -1px; }
.pricing-price span { font-size: 17px; font-weight: 400; color: rgba(255,255,255,0.4); }
.pricing-desc { font-size: 12px; color: rgba(255,255,255,0.4); margin: 8px 0 20px; }
.pricing-features { list-style: none; text-align: left; }
.pricing-features li { font-size: 13px; color: rgba(255,255,255,0.6); padding: 6px 0; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pricing-features li i { color: var(--success); font-size: 11px; }

.section-title { text-align: center; margin-bottom: 52px; }
.section-tag {
  display: inline-block;
  background: rgba(0,102,255,0.12); color: #4d94ff;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2.5px;
  padding: 6px 16px; border-radius: 99px; margin-bottom: 16px;
}
.section-h2 { font-size: 36px; font-weight: 900; color: #fff; letter-spacing: -1px; }
.section-sub { font-size: 16px; color: rgba(255,255,255,0.38); margin-top: 10px; }

/* ── Toast Notifications ── */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 500; max-width: 360px; }
.toast-item {
  background: var(--primary); color: #e2e8f0;
  padding: 13px 18px; border-radius: 10px;
  font-size: 13.5px; margin-top: 8px;
  box-shadow: 0 8px 28px rgba(26,43,74,0.35);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.25s ease;
  border-left: 3px solid var(--accent);
}
.toast-item.success { border-color: var(--success); }
.toast-item.error   { border-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Auth Screen ── */
.auth-screen { min-height: 100vh; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.auth-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 40px;
  width: 100%; max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-title { font-size: 24px; font-weight: 800; color: #f1f5f9; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: rgba(255,255,255,0.4); }
.auth-divider { text-align: center; color: rgba(255,255,255,0.25); font-size: 12px; margin: 20px 0; position: relative; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.06); }
.auth-divider span { background: rgba(255,255,255,0.04); padding: 0 12px; position: relative; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .hero h1 { font-size: 36px; letter-spacing: -1px; }
  .landing-nav, .hero, .features-section, .pricing-section { padding-left: 20px; padding-right: 20px; }
}

/* ── Utility ── */
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
