/* Chilo Legal — Design System CSS */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --teal: #007A8C;
  --teal-light: #E6F4F6;
  --teal-hover: #005F6E;

  --bg: #F6F8F7;
  --card: #FFFFFF;
  --text: #1A2226;
  --text-secondary: #4A5A60;
  --text-muted: #6B7D85;
  --border: #D1DADD;

  --sidebar-bg: #0F171A;
  --sidebar-link: #D8DEDF;
  --sidebar-muted: #8FA3A8;
  --sidebar-hover: rgba(0, 188, 228, 0.10);

  --success: #047857;
  --success-bg: #D1FAE5;
  --warning: #B45309;
  --warning-bg: #FEF3C7;
  --error: #B91C1C;
  --error-bg: #FEE2E2;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10);

  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

.dark {
  --bg: #0D1416;
  --card: #141E21;
  --text: #E8ECEC;
  --text-secondary: #A8B8BC;
  --text-muted: #789096;
  --border: #2A3A3E;
  --sidebar-bg: #080E10;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }

a { color: var(--teal); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--teal-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button, a, [role="button"], .clickable, summary, select { cursor: pointer; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 1.25rem; border-radius: var(--radius-md); font-weight: 500;
  border: 1px solid transparent; transition: all 150ms ease; font-family: var(--font-body);
  font-size: 0.95rem; line-height: 1.2;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-hover); color: #fff; text-decoration: none; }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--teal); background: var(--teal-light); text-decoration: none; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500; line-height: 1.4;
}
.badge-vigente { background: var(--success-bg); color: var(--success); }
.badge-derogado { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-trust { background: var(--teal-light); color: var(--teal); }

/* Empty state */
.empty-state {
  text-align: center; padding: 2.5rem 1.5rem;
}
.empty-state-icon {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  color: var(--text-muted);
}
.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-secondary); margin-bottom: 1.25rem; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Trust bar */
.trust-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.25rem;
  padding: 0.5rem 1rem; font-size: 0.78rem; color: var(--text-muted);
  background: var(--card); border-bottom: 1px solid var(--border);
}
.trust-bar svg { width: 14px; height: 14px; }

/* Forms */
input, textarea, select {
  font-family: var(--font-body);
  padding: 0.65rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); color: var(--text); font-size: 0.95rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,122,140,0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.35rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Responsive type scale */
@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
}

@media (min-width: 1024px) {
  h1 { font-size: 3rem; }
}
