:root {
  --primary: #1a365d;
  --primary-dark: #0f233d;
  --primary-light: #2b6cb0;
  --accent: #b7791f;
  --accent-light: #d69e2e;
  --text-main: #2d3748;
  --text-muted: #4a5568;
  --bg-light: #f7fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --success: #38a169;
  --warning: #dd6b20;
  --danger: #e53e3e;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  color: var(--text-main);
  background-color: var(--bg-light);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--primary);
  color: #fff;
  border-bottom: 3px solid var(--accent);
  padding: 1rem 0;
}

.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  background-color: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  color: #edf2f7;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  font-size: 0.95rem;
}

nav a:hover, nav a.active {
  color: var(--accent-light);
}

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 3rem 0;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.hero h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.hero p {
  font-size: 1.15rem;
  color: #cbd5e0;
  max-width: 800px;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-light);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: #fff;
  border: 2px solid #cbd5e0;
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

main {
  flex: 1;
  padding-bottom: 3rem;
}

.section-title {
  font-size: 1.75rem;
  color: var(--primary);
  margin: 2.5rem 0 1.25rem 0;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.card h3 {
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-link {
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.content-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.content-box h2 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-box h3 {
  color: var(--primary-light);
  font-size: 1.2rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.content-box p, .content-box ul, .content-box ol {
  margin-bottom: 1rem;
}

.content-box ul, .content-box ol {
  padding-left: 1.5rem;
}

.calc-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.form-group small {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 1rem;
  color: var(--text-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2);
}

.result-box {
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-box.balanced {
  border-color: var(--success);
  background: #f0fff4;
}

.result-box.imbalanced {
  border-color: var(--danger);
  background: #fff5f5;
}

.result-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}

.result-stat:last-child {
  border-bottom: none;
}

.result-stat.total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  border-top: 2px solid var(--primary);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-statute {
  background-color: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.alert-warning {
  background-color: #fffaf0;
  border-left: 4px solid var(--warning);
  color: #7b341e;
}

.alert-info {
  background-color: #ebf8ff;
  border-left: 4px solid var(--primary-light);
  color: #2b6cb0;
}

footer {
  background-color: var(--primary-dark);
  color: #a0aec0;
  padding: 2.5rem 0 1.5rem 0;
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: #cbd5e0;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-disclaimer {
  border-top: 1px solid #2d3748;
  padding-top: 1.5rem;
  color: #718096;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .grid { grid-template-columns: 1fr; }
  nav ul { gap: 0.75rem; }
}