:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --primary: #1e3a8a; /* Navy Ortolan */
    --accent: #06b6d4; /* Ciano */
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --surface: #1e293b;
        --text: #f8fafc;
        --text-muted: #94a3b8;
        --border: #334155;
        --primary: #3b82f6;
    }
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 2rem 1rem;
    line-height: 1.5;
}

.container {
    max-width: 550px;
    margin: 0 auto;
}

header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

h1 {
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

.subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.calculator {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.full-width {
    grid-column: 1 / -1;
}

.input-group {
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    box-sizing: border-box;
}

input:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.btn:hover {
    opacity: 0.9;
}

.hidden { display: none !important; }

.results {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    margin-bottom: 1.5rem;
    text-align: center;
}

.results h2 {
    font-size: 1rem;
    margin: 0 0 1rem 0;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-box {
    margin-bottom: 0.5rem;
}

.power-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}

.result-diff {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.clinical-rule {
    font-size: 0.85rem;
    background: var(--bg);
    padding: 0.75rem;
    border-radius: 4px;
    text-align: left;
}

.reference-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.reference-table h2 {
    padding: 1rem;
    margin: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    text-align: center;
    font-size: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

th:first-child, td:first-child {
    text-align: left;
}

th {
    font-weight: 600;
    color: var(--text-muted);
}

tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 480px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 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, #17202a); margin-bottom: 0.5rem; }
.references p { margin-bottom: 1rem; color: var(--text-secondary, #475569); }
.references ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.references li { margin-bottom: 0.5rem; color: var(--text-secondary, #475569); }
.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; }
