/*
 * emazed.com · brand tokens for the shared kit (templates/_shared/site.css), then what this site alone needs.
 * Brand: navy #003557 and green #00ce8f from the logo. Green buttons carry navy text (6:1 contrast); green text on
 * white uses the darker --brand-strong.
 */
:root {
    --brand: #00ce8f;
    --brand-ink: #003557;
    --brand-hover: #00b47d;
    --brand-strong: #007a55;
    --brand-soft: #e6f9f2;
    --accent: #f59e0b;
    --ink: #003557;
    --text: #263446;
    --muted: #586679;
    --dark: #002a45;
    --dark-text: #c3d2de;
}

/* Calculators and planning tools (calculators, budget-planner, financial-goal-setting, financial-health-checklist) */
.tool { display: grid; gap: 1.5rem; }
.tool-result { padding: 1.25rem; border-radius: var(--radius); background: var(--brand-soft); }
.tool-result strong { font-size: 1.6rem; color: var(--ink); display: block; }
.tool-result > div > span { display: block; font-size: .9rem; }
.tool-chart { position: relative; min-height: 260px; height: clamp(260px, 45vw, 380px); }   /* Chart.js fills it (maintainAspectRatio: false) */
.tool-chart-sm { min-height: 200px; height: 200px; }
.tool-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.tool-grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.tool > h2, .tool .row-between > h2 { font-size: 1.35rem; margin: 0; }
.tool-entry { padding: 1rem; border-radius: var(--radius-sm); background: var(--bg-alt); }
.tool .num, .form .tool-table input.num { text-align: right; }
.tool .field-error { display: none; }
.tool .was-validated :invalid ~ .field-error { display: block; }
.tool .was-validated :invalid { border-color: var(--danger); }
.tool-links h2 { font-size: 1.15rem; }
.tool-links ul { margin: 0; }
.tool-buttons { display: grid; gap: .5rem; }
.tool-month { max-width: 20rem; }
/* Financial health scorecard */
.tool-checks { display: grid; gap: .6rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.tool-checks legend { padding: 0; margin-bottom: .6rem; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.tool .notice h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.tool .notice p, .tool .notice ul { margin: .5rem 0 0; }
.tool-good { color: var(--success); }
.tool-fair { color: #9a5800; }
.tool-poor { color: var(--danger); }
/* Financial goals */
.tool-goal .card-body { display: grid; gap: .75rem; padding: 1.1rem 1.25rem; }
.tool-goal h3 { font-size: 1.1rem; margin: 0; overflow-wrap: anywhere; }
.tool-goal-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.tool-progress { height: 1.4rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.tool-progress > span { display: block; height: 100%; min-width: 2.75rem; max-width: 100%; background: var(--brand); color: var(--brand-ink); font-size: .8rem; font-weight: 700; line-height: 1.4rem; text-align: center; border-radius: inherit; }
.tool-delete { background: var(--danger); color: #fff; }
.tool-delete:hover { background: #a31f1f; color: #fff; }
.tool-dialog { width: min(32rem, calc(100% - 2 * var(--gutter))); padding: 1.5rem; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); color: var(--text); }
.tool-dialog::backdrop { background: rgb(10 15 25 / .6); }
.tool-dialog .row-between { flex-wrap: nowrap; margin-bottom: 1rem; }
.tool-dialog h2 { font-size: 1.25rem; margin: 0; }
.tool-close { flex: none; width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font-size: 1.75rem; line-height: 1; cursor: pointer; }
.tool-close:hover { background: var(--bg-alt); color: var(--ink); }
/* Budget planner: the tables scroll sideways on a phone */
.tool-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tool-table table { min-width: 30rem; margin: 0; }
.tool-table th, .tool-table td { padding: .5rem; vertical-align: middle; }
.form .tool-table input[type="text"], .form .tool-table input[type="number"], .form .tool-table select { min-height: 44px; }
.tool-col-amount { width: 10rem; }
.tool-col-remove { width: 3.5rem; }
.tool-remove { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: #fdecec; color: var(--danger); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.tool-remove:hover { background: var(--danger); color: #fff; }

/* Pages */
/* Legal pages (terms, privacy, mobile-*): section headings at reading size; terms' headings are all caps */
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
/* Course lesson (course.tpl): the stored YouTube iframe (560x600 attributes) scales to the column at 16:9 */
.lesson-video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin-inline: auto; border: 0; border-radius: var(--radius-sm); }
