/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --navy: #1a3a5c;
  --navy-dark: #122940;
  --navy-light: #2a5080;
  --gold: #c9a227;
  --gold-light: #e8c04a;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --red: #dc2626;
  --red-light: #fef2f2;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 480px; margin: 0 auto; padding: 0 16px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--primary { background: var(--navy); color: var(--white); }
.btn--primary:hover:not(:disabled) { background: var(--navy-light); text-decoration: none; }
.btn--gold { background: var(--gold); color: var(--navy-dark); }
.btn--gold:hover:not(:disabled) { background: var(--gold-light); text-decoration: none; }
.btn--outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn--outline:hover:not(:disabled) { background: var(--navy); color: var(--white); text-decoration: none; }
.btn--danger { background: var(--red); color: var(--white); }
.btn--full { width: 100%; }
.btn--lg { padding: 16px 32px; font-size: 1.1rem; }
.btn--sm { padding: 8px 16px; font-size: 0.875rem; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--gray-800); font-size: 0.95rem; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--navy);
}
.form-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.form-textarea--lg { min-height: 180px; }
.form-hint { font-size: 0.85rem; color: var(--gray-600); margin-top: 4px; }
.form-error { font-size: 0.85rem; color: var(--red); margin-top: 4px; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card--bordered { border: 1px solid var(--gray-200); box-shadow: none; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.alert--error { background: var(--red-light); color: var(--red); border: 1px solid #fca5a5; }
.alert--warn { background: var(--orange-light); color: var(--orange); border: 1px solid #fdba74; }
.alert--success { background: var(--green-light); color: var(--green); border: 1px solid #86efac; }
.alert--info { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  background: var(--navy-dark);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav__logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}
.nav__logo span { color: var(--gold); }
.nav__links { display: flex; align-items: center; gap: 16px; }
.nav__link { color: var(--gray-400); font-size: 0.9rem; font-weight: 500; }
.nav__link:hover { color: var(--white); text-decoration: none; }
.nav__user { color: var(--gold); font-size: 0.85rem; font-weight: 600; }

/* ─── Hero (Landing) ─────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  color: var(--white);
  padding: 80px 16px 60px;
  text-align: center;
}
.hero__badge {
  display: inline-block;
  background: rgba(201, 162, 39, 0.2);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
}
.hero__title span { color: var(--gold); }
.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.hero__cta-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero__proof {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}
.hero__proof-item { display: flex; align-items: center; gap: 6px; }
.hero__proof-item::before { content: '✓'; color: var(--gold); font-weight: 700; }

/* ─── Features ───────────────────────────────────────────────────────────── */
.features { padding: 64px 16px; background: var(--white); }
.features__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; margin-top: 40px; }
.feature-card { padding: 24px; border-radius: var(--radius); background: var(--gray-50); border: 1px solid var(--gray-200); }
.feature-card__icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--navy); }
.feature-card__desc { font-size: 0.95rem; color: var(--gray-600); line-height: 1.6; }

/* ─── Pricing ────────────────────────────────────────────────────────────── */
.pricing { padding: 64px 16px; background: var(--gray-50); text-align: center; }
.pricing__card {
  max-width: 400px;
  margin: 40px auto 0;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 2px solid var(--navy);
}
.pricing__header { background: var(--navy); color: var(--white); padding: 28px; }
.pricing__name { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.pricing__price { font-size: 3rem; font-weight: 900; color: var(--gold); }
.pricing__price sup { font-size: 1.5rem; vertical-align: top; margin-top: 8px; }
.pricing__period { font-size: 0.9rem; color: rgba(255,255,255,0.7); }
.pricing__body { padding: 28px; }
.pricing__features { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing__features li { padding: 8px 0; border-bottom: 1px solid var(--gray-100); display: flex; gap: 10px; }
.pricing__features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }
.pricing__trial { font-size: 0.85rem; color: var(--gray-600); margin-top: 12px; }

/* ─── Section Headers ────────────────────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 8px; }
.section-header__eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.section-header__title { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; color: var(--navy-dark); }
.section-header__sub { font-size: 1rem; color: var(--gray-600); margin-top: 12px; }

/* ─── Auth Page ──────────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-page__hero {
  background: var(--navy-dark);
  padding: 40px 16px;
  text-align: center;
  color: var(--white);
}
.auth-page__hero-title { font-size: 1.8rem; font-weight: 900; }
.auth-page__hero-title span { color: var(--gold); }
.auth-page__hero-sub { color: rgba(255,255,255,0.7); margin-top: 8px; font-size: 0.95rem; }
.auth-page__body { flex: 1; padding: 32px 16px; }
.auth-tabs { display: flex; margin-bottom: 28px; border-bottom: 2px solid var(--gray-200); }
.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  color: var(--gray-600);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all 0.2s;
}
.auth-tab--active { color: var(--navy); border-bottom-color: var(--navy); }

/* ─── App Layout ─────────────────────────────────────────────────────────── */
.app-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 60px); }
@media (max-width: 768px) { .app-layout { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--navy-dark);
  color: var(--white);
  padding: 20px 0;
  min-height: calc(100vh - 60px);
}
@media (max-width: 768px) {
  .sidebar { min-height: auto; padding: 12px 0; }
}
.sidebar__section { padding: 8px 16px; margin-bottom: 4px; }
.sidebar__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
  padding: 0 8px;
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar__item:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.sidebar__item--active { background: rgba(201,162,39,0.15); color: var(--gold); }
.sidebar__item-icon { font-size: 1.1rem; flex-shrink: 0; }

.main-content { padding: 24px; overflow-y: auto; }
@media (max-width: 768px) { .main-content { padding: 16px; } }

/* ─── App Panels ─────────────────────────────────────────────────────────── */
.panel { display: none; }
.panel--active { display: block; }

.panel-title { font-size: 1.4rem; font-weight: 800; color: var(--navy-dark); margin-bottom: 4px; }
.panel-sub { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 24px; }

/* ─── Query Panel ────────────────────────────────────────────────────────── */
.query-response {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border-left: 4px solid var(--navy);
  box-shadow: var(--shadow);
  margin-top: 20px;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.7;
}
.query-response__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}
.query-response__title { font-weight: 700; color: var(--navy); font-size: 1rem; }
.query-response__sections { font-size: 0.8rem; color: var(--gray-400); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-100); }

.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  color: var(--gray-600);
  font-style: italic;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Deadline Panel ─────────────────────────────────────────────────────── */
.deadline-result {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.deadline-result__date { font-size: 1.5rem; font-weight: 800; color: var(--navy-dark); }
.deadline-result__message { margin-top: 8px; font-size: 1rem; font-weight: 600; }
.deadline-result--urgent .deadline-result__message { color: var(--red); }
.deadline-result--warn .deadline-result__message { color: var(--orange); }
.deadline-result--ok .deadline-result__message { color: var(--green); }

/* ─── Cases Panel ────────────────────────────────────────────────────────── */
.case-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.case-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--gray-200);
}
.case-item:hover { border-color: var(--navy); transform: translateY(-1px); }
.case-item__title { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.case-item__date { font-size: 0.8rem; color: var(--gray-400); }
.case-item__preview { font-size: 0.875rem; color: var(--gray-600); margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ─── Subscription Banner ────────────────────────────────────────────────── */
.sub-banner {
  background: var(--orange-light);
  border: 1px solid #fdba74;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sub-banner__text { font-size: 0.95rem; color: var(--orange); font-weight: 600; }
.sub-banner__trial { font-size: 0.8rem; color: var(--gray-600); margin-top: 2px; }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--gray-600); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 24px 0; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 24px 16px;
  font-size: 0.85rem;
}
.footer a { color: rgba(255,255,255,0.6); }
