:root {
  --bg-color: #fffdf7;
  --surface: #ffffff;
  --text-primary: #17202a;
  --text-secondary: #475569;
  --accent: #f6b84b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-primary); line-height: 1.6;
}
h1, h3, .badge { font-family: 'Georgia', serif; }
.app-container { max-width: 650px; margin: 0 auto; padding: 3rem 1.5rem; }
.header { text-align: center; margin-bottom: 2rem; }
.badge { display: inline-block; background: var(--text-primary); color: #fff; padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; margin-bottom: 1rem; }
.header h1 { font-size: 2.2rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.header p { color: var(--text-secondary); }

.calculator {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.full-width { grid-column: 1 / -1; }
@media(max-width: 500px) { .form-grid { grid-template-columns: 1fr; } }

.input-group label {
  display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem;
}
input[type="number"] {
  width: 100%; padding: 0.8rem; border: 2px solid var(--border); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 1rem; outline: none; transition: 0.2s; background: var(--surface); color: var(--text-primary);
}
input[type="number"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(246, 184, 75, 0.2);
}
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1; height: 30px;
}

.toggle-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toggle-group input[type="radio"] { display: none; }
.btn-toggle {
  flex: 1; text-align: center; padding: 0.8rem; background: var(--surface); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.2s; color: var(--text-secondary); font-size: 0.95rem; min-width: 100px;
}
.toggle-group input[type="radio"]:checked + .btn-toggle {
  background: rgba(246, 184, 75, 0.15); border-color: var(--warning); color: #d97706; box-shadow: 0 0 10px rgba(246, 184, 75, 0.3);
}

.main-btn {
  width: 100%; background: var(--text-primary); color: white; border: none; padding: 1.2rem; font-size: 1.1rem; border-radius: 8px; cursor: pointer; transition: all 0.3s; margin-top: 2rem; font-weight: bold;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.main-btn:hover, .main-btn:active {
  background: var(--warning); color: white; transform: translateY(-2px); box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
}

.result-card {
  margin-top: 2.5rem; padding-top: 2rem; border-top: 1px dashed var(--border); text-align: center;
}
.result-card h3 { font-size: 1.5rem; margin-bottom: 1.5rem; transition: color 0.5s; }

.risk-circle {
  width: 130px; height: 130px; border-radius: 50%; border: 6px solid var(--text-primary); display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 1.5rem auto; color: var(--text-primary); transition: all 0.5s;
}
#risk-val { font-size: 2.5rem; font-weight: bold; line-height: 1; }

.advice-list {
  text-align: left; padding: 1.5rem; background: var(--bg-color); border: 1px solid var(--border); border-radius: 8px; list-style: none; display: flex; flex-direction: column; gap: 1rem;
}
.advice-list li { position: relative; padding-left: 1.8rem; font-size: 0.95rem; color: var(--text-primary); }
.advice-list li::before { content: "👉"; position: absolute; left: 0; top: 0; }

/* --- CSS DE REFERÊNCIAS --- */
.references { margin-top: 2rem; padding: 1.5rem; background: rgba(15,23,42,0.05); border-radius: 8px; font-size: 0.9rem; text-align: left; }
.references h3 { margin-top: 0; font-size: 1rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.references p { margin-bottom: 1rem; color: var(--text-secondary); }
.references ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.references li { margin-bottom: 0.5rem; color: var(--text-secondary); }
.references a { color: #0ea5e9; text-decoration: none; font-weight: bold; }
.references .disclaimer { margin-top: 1rem; font-style: italic; color: #64748b; font-size: 0.85rem; border-top: 1px solid rgba(0,0,0,0.1); padding-top: 0.8rem; }
