/* comply.automate48.ai — Product styles */

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

:root {
  --navy:    #0f172a;
  --navy-2:  #1e293b;
  --navy-3:  #334155;
  --blue:    #1d4ed8;
  --blue-2:  #2563eb;
  --blue-light: #eff6ff;
  --slate:   #64748b;
  --slate-2: #94a3b8;
  --line:    #e2e8f0;
  --bg:      #f8fafc;
  --white:   #ffffff;
  --radius:  6px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);

  /* Maturity level colors */
  --l1: #ef4444;
  --l2: #f97316;
  --l3: #eab308;
  --l4: #22c55e;
  --l5: #3b82f6;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--navy-2); line-height: 1.5; }

a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.app-header {
  grid-column: 1 / -1;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  border-bottom: 1px solid var(--navy-3);
}

.app-header .logo { font-weight: 700; font-size: 15px; white-space: nowrap; }
.app-header .logo span { color: var(--blue-2); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-user { font-size: 13px; color: var(--slate-2); }
.tier-pill {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; background: var(--blue); color: #fff; text-transform: uppercase; letter-spacing: .05em;
}

/* ── Sidebar navigation ──────────────────────────────────────────────────── */

.app-sidebar {
  background: var(--navy-2);
  color: var(--white);
  overflow-y: auto;
  padding: 12px 0;
  border-right: 1px solid var(--navy-3);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  padding: 0 8px 8px;
  gap: 2px;
  border-bottom: 1px solid var(--navy-3);
  margin-bottom: 8px;
}

.sidebar-link {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--slate-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-link:hover { background: var(--navy-3); color: var(--white); }

.nav-group { margin-bottom: 4px; }

.nav-domain {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--slate);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--slate-2);
  cursor: pointer;
  border-radius: 4px;
  margin: 0 4px;
  transition: background .12s, color .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover  { background: var(--navy-3); color: var(--white); }
.nav-item.active { background: var(--blue); color: var(--white); }

.nav-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  background: var(--slate);
  color: #fff;
}
.nav-badge.level-1 { background: var(--l1); }
.nav-badge.level-2 { background: var(--l2); }
.nav-badge.level-3 { background: var(--l3); color: var(--navy); }
.nav-badge.level-4 { background: var(--l4); color: var(--navy); }
.nav-badge.level-5 { background: var(--l5); }

/* ── Main content ────────────────────────────────────────────────────────── */

#main-content {
  overflow-y: auto;
  padding: 28px 32px;
}

.loading { color: var(--slate); padding: 40px 0; text-align: center; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */

.dashboard-header { margin-bottom: 24px; }
.dashboard-header h1 { font-size: 22px; font-weight: 700; color: var(--navy); }
.company-name { color: var(--slate); font-size: 14px; margin-top: 4px; }

.stat-row { display: flex; gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px;
  flex: 1; box-shadow: var(--shadow);
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 13px; color: var(--slate); margin-top: 4px; }

.domain-section { margin-bottom: 36px; }
.domain-title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.domain-desc  { font-size: 13px; color: var(--slate); margin-bottom: 14px; }

.control-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.control-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.control-card:hover { border-color: var(--blue-2); box-shadow: 0 2px 8px rgba(29,78,216,.12); }

.control-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.control-id { font-size: 11px; font-weight: 700; color: var(--blue-2); letter-spacing: .05em; }
.control-name { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.control-desc { font-size: 12px; color: var(--slate); line-height: 1.4; margin-bottom: 12px; }
.control-card-footer { display: flex; align-items: center; justify-content: space-between; }
.owner-tag { font-size: 11px; color: var(--slate-2); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; }

.maturity-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; white-space: nowrap;
}
.maturity-badge.level-0 { background: #f1f5f9; color: var(--slate); }
.maturity-badge.level-1 { background: #fee2e2; color: #b91c1c; }
.maturity-badge.level-2 { background: #ffedd5; color: #c2410c; }
.maturity-badge.level-3 { background: #fef9c3; color: #a16207; }
.maturity-badge.level-4 { background: #dcfce7; color: #15803d; }
.maturity-badge.level-5 { background: #dbeafe; color: #1d4ed8; }

.onboarding-banner {
  margin-top: 24px;
  background: var(--blue-light); border: 1px solid #bfdbfe;
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 14px; color: var(--navy-2);
  display: flex; align-items: center; gap: 16px;
}

/* ── Control view ────────────────────────────────────────────────────────── */

.control-view { display: flex; flex-direction: column; height: 100%; }

.control-view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px; gap: 20px;
}
.control-id-large {
  font-size: 11px; font-weight: 700; color: var(--blue-2);
  letter-spacing: .08em; text-transform: uppercase;
  display: block; margin-bottom: 4px;
}
.control-view-header h1 { font-size: 20px; font-weight: 700; color: var(--navy); }
.control-meta { font-size: 13px; color: var(--slate); margin-top: 6px; }

.control-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.maturity-select-label { font-size: 12px; color: var(--slate); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.maturity-select-label select { font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }

.control-desc-full { font-size: 14px; color: var(--navy-3); margin-bottom: 20px; line-height: 1.6; }

/* ── Chat panel ──────────────────────────────────────────────────────────── */

.chat-panel {
  flex: 1; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow);
  overflow: hidden; min-height: 0;
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--navy-2);
  background: var(--bg);
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}

.chat-empty { color: var(--slate); font-size: 14px; }
.chat-empty p { margin-bottom: 8px; }

.msg { max-width: 88%; }
.msg-user      { align-self: flex-end; }
.msg-assistant { align-self: flex-start; }

.msg-label { font-size: 11px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }
.msg-user .msg-label { text-align: right; }

.msg-body {
  font-size: 14px; line-height: 1.6;
  border-radius: var(--radius); padding: 12px 14px;
}
.msg-user .msg-body      { background: var(--blue); color: #fff; }
.msg-assistant .msg-body { background: var(--bg); border: 1px solid var(--line); color: var(--navy-2); }

.msg-body.streaming::after {
  content: '▌'; animation: blink .8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.msg-body h1, .msg-body h2, .msg-body h3, .msg-body h4 { margin: 12px 0 6px; font-size: 14px; font-weight: 700; }
.msg-body p  { margin-bottom: 8px; }
.msg-body ul { padding-left: 20px; margin-bottom: 8px; }
.msg-body li { margin-bottom: 4px; }
.msg-body pre { background: var(--navy); color: #e2e8f0; padding: 12px; border-radius: var(--radius); overflow-x: auto; font-size: 12px; margin: 8px 0; }
.msg-body code { font-family: 'Fira Code', 'Courier New', monospace; font-size: 12px; }
.msg-body > p:last-child { margin-bottom: 0; }

.chat-input-area {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: var(--bg);
}
.chat-input-area textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  resize: none; outline: none; background: var(--white);
  transition: border-color .15s;
}
.chat-input-area textarea:focus { border-color: var(--blue-2); }
.chat-input-actions { display: flex; align-items: center; justify-content: flex-end; margin-top: 8px; gap: 10px; }
.session-hint { font-size: 12px; color: var(--slate-2); }

.upgrade-banner {
  background: #fef9c3; border: 1px solid #fde68a;
  border-radius: var(--radius); padding: 20px 24px;
  font-size: 14px; color: var(--navy-2);
  display: flex; align-items: center; gap: 16px;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form-panel {
  max-width: 560px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 32px;
  box-shadow: var(--shadow);
}
.form-panel h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.form-panel > p { font-size: 13px; color: var(--slate); margin-bottom: 24px; line-height: 1.5; }

form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 13px; font-weight: 500; }
form input, form select, form textarea {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
form input:focus, form select:focus, form textarea:focus { border-color: var(--blue-2); }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary, .btn-secondary, .btn-ghost, .btn-open, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.btn-primary   { background: var(--blue-2); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-secondary { background: var(--bg); color: var(--navy-2); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--line); }
.btn-ghost     { background: transparent; color: var(--slate); font-weight: 400; padding: 4px 8px; }
.btn-ghost:hover { color: var(--navy); }
.btn-open      { background: var(--blue-light); color: var(--blue-2); padding: 5px 12px; font-size: 12px; }
.btn-open:hover { background: #dbeafe; }
.btn-danger    { background: #fee2e2; color: #b91c1c; }

/* ── Auth pages ──────────────────────────────────────────────────────────── */

.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: var(--bg);
  padding: 20px;
}

.auth-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px 40px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.auth-card .logo { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.auth-card .logo span { color: var(--blue-2); }
.auth-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

.error-msg {
  display: none; background: #fee2e2; color: #b91c1c;
  border: 1px solid #fecaca; border-radius: var(--radius);
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}
.success-msg {
  display: none; background: #dcfce7; color: #15803d;
  border: 1px solid #bbf7d0; border-radius: var(--radius);
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

.auth-footer { margin-top: 20px; font-size: 13px; color: var(--slate); text-align: center; }
.tab-bar { display: flex; border-bottom: 2px solid var(--line); margin-bottom: 24px; }
.tab { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--slate); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--blue-2); border-bottom-color: var(--blue-2); }

/* ── Landing page ────────────────────────────────────────────────────────── */

.landing { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.site-header {
  display: flex; align-items: center; padding: 18px 0;
  border-bottom: 1px solid var(--line); margin-bottom: 0;
}
.site-header .logo { font-size: 15px; font-weight: 700; }
.site-header .logo span { color: var(--blue-2); }
.site-header nav { margin-left: auto; display: flex; gap: 24px; align-items: center; }
.site-header nav a { font-size: 14px; color: var(--navy-2); }

.hero {
  text-align: center; padding: 72px 0 60px;
  max-width: 720px; margin: 0 auto;
}
.hero-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue-2); background: var(--blue-light);
  border: 1px solid #bfdbfe; border-radius: 20px; padding: 4px 14px; margin-bottom: 20px;
}
.hero h1 { font-size: 42px; font-weight: 800; line-height: 1.15; color: var(--navy); margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--blue-2); }
.hero p { font-size: 18px; color: var(--slate); line-height: 1.6; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 60px 0; }
.section-title { font-size: 28px; font-weight: 700; color: var(--navy); margin-bottom: 8px; text-align: center; }
.section-sub { font-size: 16px; color: var(--slate); text-align: center; margin-bottom: 48px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feature-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 24px; margin-bottom: 12px; }
.feature-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feature-card p  { font-size: 13px; color: var(--slate); line-height: 1.5; }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 900px; margin: 0 auto; }
.pricing-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow);
}
.pricing-card.featured { border-color: var(--blue-2); box-shadow: 0 4px 20px rgba(29,78,216,.15); }
.pricing-card .tier-name { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-2); margin-bottom: 8px; }
.pricing-card .price { font-size: 32px; font-weight: 800; color: var(--navy); }
.pricing-card .price sup { font-size: 18px; font-weight: 600; }
.pricing-card .price-period { font-size: 13px; color: var(--slate); }
.pricing-card ul { list-style: none; margin: 20px 0 24px; }
.pricing-card ul li { font-size: 13px; color: var(--navy-2); padding: 5px 0; border-bottom: 1px solid var(--bg); }
.pricing-card ul li::before { content: '✓ '; color: var(--blue-2); font-weight: 700; }

.site-footer {
  border-top: 1px solid var(--line); padding: 28px 0;
  font-size: 12px; color: var(--slate); text-align: center;
}

/* ── Utilities ───────────────────────────────────────────────────────────── */

.text-center { text-align: center; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 56px auto 1fr; }
  .app-sidebar { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  #main-content { padding: 16px; }
}
