/* =====================================================================
   Amar Daatgal · Neo-Insurance AI Platform
   Design System v1 — Lemonade + Wefox + Mongolian rouge
===================================================================== */

:root {
  --ink:       #0F1419;
  --ink-2:     #1C2530;
  --white:     #FFFFFF;
  --cream:     #FFF8F0;
  --sand:      #F5EFE4;
  --sand-2:    #FAF6EE;
  --border:    #E2DCD0;
  --border-2:  #F0EAD8;

  --amar:      #C8102E;
  --amar-dk:   #A00E26;
  --amar-tint: #FCEDEF;
  --coral:     #FF6B6B;
  --rose:      #FFE5E8;

  --mint:      #06D6A0;
  --mint-tint: #E0FFF7;
  --amber:     #F59E0B;
  --amber-tint:#FEF3C7;
  --violet:    #7C3AED;
  --violet-tint:#EDE9FE;
  --sky:       #0EA5E9;
  --sky-tint:  #E0F2FE;

  --slate:     #475569;
  --slate-2:   #64748B;
  --muted:     #94A3B8;
  --soft:      #CBD5E1;

  --shadow-sm: 0 1px 2px rgba(15,20,25,0.04);
  --shadow:    0 4px 24px rgba(15,20,25,0.06);
  --shadow-lg: 0 16px 48px rgba(15,20,25,0.12);
  --shadow-amar: 0 8px 24px rgba(200,16,46,0.18);

  --font-display: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.2,.8,.2,1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--amar); text-decoration: none; }
a:hover { color: var(--amar-dk); }

button { font-family: inherit; cursor: pointer; }

/* ============ TYPE ============ */

.h-display { font-family: var(--font-display); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); }
.h-hero    { font-size: clamp(2.5rem, 5vw, 4.5rem); }
.h-h1      { font-size: clamp(2rem, 3.5vw, 3rem); }
.h-h2      { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.h-h3      { font-size: 1.25rem; font-weight: 700; }

.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--slate-2); }
.text-amar { color: var(--amar); }
.text-mint { color: var(--mint); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amar);
}

/* ============ LAYOUT ============ */

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }

.section { padding: clamp(64px, 8vw, 120px) 0; }
.section-tight { padding: clamp(40px, 5vw, 64px) 0; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }

/* ============ NAV ============ */

.nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 248, 240, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-2);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 24px;
  max-width: 1280px; margin: 0 auto;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}
.nav-emblem {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amar); color: white;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 0.85rem;
}
.nav-brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--slate-2);
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: 28px; align-items: center; list-style: none; }
.nav-links a {
  color: var(--ink); text-decoration: none;
  font-size: 0.93rem; font-weight: 500;
  transition: color 200ms var(--ease);
}
.nav-links a:hover { color: var(--amar); }
.nav-cta { display: flex; gap: 10px; align-items: center; }

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 220ms var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--amar); color: white; box-shadow: var(--shadow-amar); }
.btn-primary:hover { background: var(--amar-dk); transform: translateY(-1px); color: white; }
.btn-ink { background: var(--ink); color: white; }
.btn-ink:hover { background: var(--ink-2); transform: translateY(-1px); color: white; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--ink); background: var(--sand-2); }
.btn-mint { background: var(--mint); color: var(--ink); }
.btn-mint:hover { background: #05c194; color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 18px 32px; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* ============ CARD ============ */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.card-sand { background: var(--sand-2); border-color: var(--border-2); }
.card-ink { background: var(--ink); color: white; border-color: var(--ink-2); }
.card-ink h1, .card-ink h2, .card-ink h3 { color: white; }

.card-accent {
  position: relative;
  padding-top: 28px;
}
.card-accent::before {
  content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 4px;
  background: var(--amar);
  border-radius: 0 0 4px 4px;
}

/* ============ STAT ============ */

.stat { padding: 24px; }
.stat-num {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--amar), var(--coral));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.stat-label {
  margin-top: 8px;
  font-family: var(--font-body); font-size: 0.85rem; color: var(--slate);
}
.stat-delta { font-size: 0.8rem; font-weight: 600; color: var(--mint); }
.stat-delta-down { color: var(--amar); }

/* ============ BADGE ============ */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  font-size: 0.75rem; font-weight: 600;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}
.badge-mint { background: var(--mint-tint); color: #047857; border: 1px solid var(--mint); }
.badge-amar { background: var(--amar-tint); color: var(--amar-dk); border: 1px solid var(--amar); }
.badge-amber { background: var(--amber-tint); color: #92400E; border: 1px solid var(--amber); }
.badge-violet { background: var(--violet-tint); color: var(--violet); border: 1px solid var(--violet); }
.badge-sky { background: var(--sky-tint); color: #0369A1; border: 1px solid var(--sky); }
.badge-ghost { background: var(--sand-2); color: var(--slate); border: 1px solid var(--border); }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.18); }
}

/* ============ FORM ============ */

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label {
  font-size: 0.78rem; font-weight: 600;
  color: var(--slate);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
  color: var(--ink);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--amar);
  box-shadow: 0 0 0 4px rgba(200,16,46,0.08);
}
.form-textarea { resize: vertical; min-height: 96px; }
.form-hint { font-size: 0.78rem; color: var(--slate-2); margin-top: 4px; }

/* ============ CHAT ============ */

.chat-window {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 480px;
  max-height: 720px;
}
.chat-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 12px;
  background: var(--sand-2);
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--amar), var(--coral));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-family: var(--font-display);
}
.chat-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.chat-sub { font-size: 0.78rem; color: var(--slate-2); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.chat-row { display: flex; gap: 10px; max-width: 78%; animation: slideUp 280ms var(--ease); }
.chat-row.user { margin-left: auto; flex-direction: row-reverse; }
.chat-bubble {
  padding: 12px 16px;
  background: var(--cream);
  border-radius: 18px 18px 18px 4px;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--ink);
  border: 1px solid var(--border-2);
}
.chat-row.user .chat-bubble {
  background: var(--amar);
  color: white;
  border-radius: 18px 18px 4px 18px;
  border-color: var(--amar);
}
.chat-bubble strong { font-weight: 700; }

.chat-typing {
  display: inline-flex; gap: 4px; padding: 16px 18px;
  background: var(--cream); border-radius: 18px 18px 18px 4px;
  border: 1px solid var(--border-2);
  width: fit-content;
}
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--mint);
  animation: typing 1.3s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.chat-input-row {
  border-top: 1px solid var(--border-2);
  padding: 16px;
  display: flex; gap: 10px; align-items: center;
  background: white;
}
.chat-input {
  flex: 1; border: 1.5px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem; font-family: inherit;
  background: white;
}
.chat-input:focus { outline: none; border-color: var(--amar); }
.chat-send {
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: var(--amar); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.chat-send:hover:not(:disabled) { background: var(--amar-dk); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-quick {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 14px 22px 0;
}
.chat-quick button {
  background: var(--rose); color: var(--amar-dk);
  border: 1px solid var(--amar-tint);
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: 0.83rem; font-weight: 600;
  transition: background 180ms var(--ease);
}
.chat-quick button:hover { background: var(--amar-tint); }

/* ============ TICKER ============ */

.ticker {
  background: var(--ink); color: white;
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex; gap: 56px;
  animation: ticker 60s linear infinite;
  padding-left: 24px;
}
.ticker-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600;
}
.ticker-item .dot { background: var(--mint); }
.ticker-item strong { color: var(--mint); font-family: var(--font-display); }
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============ HERO ============ */

.hero {
  background: linear-gradient(180deg, var(--cream) 0%, var(--sand-2) 100%);
  position: relative;
  overflow: hidden;
  padding: 64px 0 96px;
}
.hero-blob {
  position: absolute; pointer-events: none;
  background: radial-gradient(circle at center, rgba(200,16,46,0.15) 0%, transparent 70%);
  width: 600px; height: 600px;
  top: -100px; right: -100px;
  filter: blur(40px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 24px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--amar), var(--coral));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 1.2rem; color: var(--slate);
  margin-bottom: 32px; line-height: 1.55;
  max-width: 540px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ TABLES ============ */

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 14px 16px;
  border-bottom: 1px solid var(--border-2);
  font-size: 0.92rem;
}
.table th {
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--slate);
  background: var(--sand-2);
}
.table tr:hover { background: var(--cream); }

/* ============ PROGRESS BARS ============ */

.bar { background: var(--sand); border-radius: var(--radius-pill); height: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--amar), var(--coral)); border-radius: var(--radius-pill); transition: width 800ms var(--ease); }
.bar-fill.mint { background: linear-gradient(90deg, var(--mint), #04A77E); }
.bar-fill.amber { background: linear-gradient(90deg, var(--amber), #D97706); }

/* ============ ANIM ============ */

@keyframes slideUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
.animate-up { animation: slideUp 360ms var(--ease) both; }

/* ============ UTILITY ============ */

.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* ============ FOOTER ============ */

.footer {
  background: var(--ink);
  color: white;
  padding: 64px 0 32px;
}
.footer h4 { font-family: var(--font-display); font-size: 0.9rem; margin-bottom: 18px; color: white; }
.footer a { color: rgba(255,255,255,0.7); font-size: 0.9rem; display: block; padding: 4px 0; }
.footer a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 48px; padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  font-size: 0.85rem; color: rgba(255,255,255,0.55);
}

/* ============ PAGE TITLES (admin) ============ */

.page-head {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.page-sub { color: var(--slate-2); font-size: 1rem; }

/* ============ SIDEBAR (admin) ============ */

.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--ink);
  color: white;
  padding: 24px 16px;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: rgba(255,255,255,0.7); font-size: 0.92rem;
  font-weight: 500; margin-bottom: 4px;
}
.admin-sidebar a.active { background: rgba(200,16,46,0.2); color: white; border-left: 3px solid var(--amar); padding-left: 9px; }
.admin-sidebar a:hover { background: rgba(255,255,255,0.06); color: white; }
.admin-main { padding: 32px 40px; max-width: 1280px; }

@media (max-width: 880px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

/* ============ AI thinking strip ============ */

.ai-strip {
  display: inline-flex; gap: 10px; align-items: center;
  padding: 8px 14px;
  background: linear-gradient(90deg, var(--mint-tint), var(--violet-tint));
  border: 1px solid var(--mint);
  border-radius: var(--radius-pill);
  font-size: 0.82rem; font-weight: 600; color: var(--ink);
}
.ai-strip .dot { background: var(--mint); }
