/* ============================================================
   DAILY NUTRITION CALCULATOR — FINAL CSS
   ============================================================ */

:root {
    --bg: #F6F8FB;
    --surface: #FFFFFF;
    --text: #172033;
    --muted: #667085;

    --primary: #0FAF8F;
    --primary-dark: #087F6B;

    --mint: #E8F8F4;
    --mint-border: #CFEDE5;

    --border: #E4E7EC;
    --input-bg: #FBFCFE;

    --error: #D92D20;
    --success: #087F6B;
    --focus: rgba(15, 175, 143, 0.18);

    --protein-bg: #F5FAFF;
    --carbs-bg: #F3FBF7;
    --fat-bg: #FFF9F2;

    --shadow: 0 4px 18px rgba(16, 24, 40, 0.06);
}

html[data-theme="dark"] {
    --bg: #071426;
    --surface: #0D1B2E;
    --text: #F2F6FA;
    --muted: #9FB0C3;

    --primary: #2DD4A8;
    --primary-dark: #18A987;

    --mint: #103C37;
    --mint-border: #1B6257;

    --border: #26415D;
    --input-bg: #102239;

    --error: #F97066;
    --success: #2DD4A8;
    --focus: rgba(45, 212, 168, 0.22);

    --protein-bg: #102A3A;
    --carbs-bg: #10352C;
    --fat-bg: #382D20;

    --shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}


/* ============================================================
   RESET / BASE
============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;
    line-height: 1.4;

    color: var(--text);
    background: var(--bg);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}


/* ============================================================
   HEADER
============================================================ */

.site-header {
    padding: 12px 24px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;

    width: 100%;

    gap: 10px;
}
.brand-link {
    display: flex;
    align-items: center;
    gap: 9px;

    color: inherit;
    text-decoration: none;
}

.brand-logo {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: block;

    object-fit: contain;
}

.brand-mark {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--mint);
    color: var(--primary-dark);

    font-size: 22px;
    font-weight: 700;
}

.brand-copy {
    min-width: 0;
}

.brand h1 {
    margin: 0;

    font-size: 19px;
    line-height: 1.2;
}

.brand p {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 11px;
}


/* ============================================================
   NAVIGATION
============================================================ */

.main-nav {
    display: flex;
    align-items: center;

    gap: 4px;

    margin-left: auto;
}

.main-nav a {
    padding: 7px 10px;

    border-radius: 7px;

    color: var(--muted);

    text-decoration: none;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--mint);
    color: var(--primary-dark);
}


/* ============================================================
   THEME BUTTON
============================================================ */

.theme-toggle {
    width: auto;

    margin: 0 0 0 8px;

    padding: 6px 9px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--input-bg);
    color: var(--text);

    font-size: 11px;
}

.theme-toggle:hover {
    background: var(--mint);

    color: var(--primary-dark);

    transform: none;

    box-shadow: none;
}


/* ============================================================
   MAIN LAYOUT
============================================================ */

main.calculator-main {
    width: min(1240px, calc(100% - 32px));

    margin: 16px auto 22px;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1.08fr);

    gap: 16px;

    align-items: start;
}

.progress-main {
    width: min(1240px, calc(100% - 32px));

    margin: 16px auto 22px;
}


/* ============================================================
   SHARED SECTIONS
============================================================ */

section {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 14px;

    box-shadow: var(--shadow);
}

.mode-section {
    grid-column: 1 / -1;
}


/* ============================================================
   HEADINGS
============================================================ */

.section-heading {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin-bottom: 7px;
}

.section-number {
    width: 26px;
    height: 26px;

    flex: 0 0 26px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--primary);
    color: white;

    font-size: 12px;
    font-weight: 700;
}

section h2 {
    margin: 0;

    color: var(--text);

    font-size: 18px;
    line-height: 1.2;
}

.section-description {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 11px;
}


/* ============================================================
   CALCULATION MODE
============================================================ */

.mode-options {
    display: flex;

    gap: 10px;

    margin-top: 14px;
}

.mode-option {
    flex: 1;

    cursor: pointer;
}

.mode-option input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}

.mode-option span {
    display: block;

    padding: 10px 14px;

    text-align: center;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--input-bg);

    transition:
        border-color .2s ease,
        background-color .2s ease,
        color .2s ease;
}

.mode-option input:checked + span {
    border-color: var(--primary);

    background: var(--mint);

    color: var(--primary-dark);

    font-weight: 600;
}


/* ============================================================
   FORM
============================================================ */

form {
    margin-top: 2px;
}

fieldset {
    border: 0;

    padding: 9px 0;

    margin: 0;

    border-top: 1px solid var(--border);
}

fieldset:first-child {
    border-top: 0;

    padding-top: 2px;
}

legend {
    padding: 0;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 13px;
    font-weight: 700;
}

.personal-grid {
    display: grid;

    /*
       Keep short fields short and give the height field the
       remaining horizontal space.
    */
    grid-template-columns:
        70px
        minmax(105px, 1fr)
        82px
        minmax(220px, 1.35fr);

    gap: 10px;

    align-items: end;
}

.field {
    min-width: 0;
}

.field > label,
.trainer-control > label,
.history-field > label,
.date-picker-field > label {
    display: block;

    margin-bottom: 4px;

    color: var(--text);

    font-size: 11px;
    font-weight: 600;
}


/* ============================================================
   INPUTS
============================================================ */

input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--input-bg);
    color: var(--text);

    font-size: 12px;
}

input[type="number"],
input[type="date"],
select {
    height: 34px;

    padding: 6px 8px;
}

textarea {
    padding: 7px 8px;

    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;

    border-color: var(--primary);

    box-shadow:
        0 0 0 3px var(--focus);
}


/* ============================================================
   COMPACT NUMERIC FIELDS
============================================================ */

#Age {
    width: 70px;
}

#Weight {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
}

.compact-unit {
    display: inline-grid;

    grid-template-columns: 58px 25px;

    width: max-content;
    max-width: 100%;

    gap: 0;
}

.compact-unit input {
    width: 58px;
    min-width: 58px;
    max-width: 58px;

    border-radius: 8px 0 0 8px;
}

.compact-unit span {
    width: 25px;
    min-width: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 8px 8px 0;

    background: var(--input-bg);
    color: var(--muted);

    font-size: 10px;
}

/* ============================================================
   HEIGHT — FIXED, COMPACT CONTROLS
============================================================ */

.height-field {
    min-width: 0;
}

.height-controls {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        58px
        58px;

    gap: 6px;

    align-items: center;
}

/* Feet / Inches: compact selector + compact numeric fields. */
.height-controls:has(#Feet:not([hidden])) {
    grid-template-columns:
        minmax(102px, 1fr)
        58px
        58px;
}

/* Centimeters: selector + one useful-width numeric field. */
.height-controls:has(#Centimeters:not([hidden])) {
    grid-template-columns:
        minmax(102px, 1fr)
        minmax(100px, 1fr);
}

.height-controls select {
    width: 100%;
    min-width: 0;
}

.height-controls input {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
}

.height-controls:has(#Centimeters:not([hidden])) #Centimeters {
    width: 100%;
    min-width: 100px;
    max-width: none;
}

.height-controls input::placeholder {
    color: var(--muted);
}

/* ============================================================
   RADIO GROUPS
============================================================ */

.radio-group {
    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 8px 14px;
}

.inline-options {
    min-height: 34px;
}

.radio-option {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    color: var(--text);

    font-size: 12px;

    white-space: nowrap;
}

.radio-option input,
.choice-card input,
.history-choice input {
    margin: 0;

    accent-color: var(--primary);
}


/* ============================================================
   ACTIVITY
============================================================ */

.activity-grid {
    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 6px;
}

.choice-card {
    position: relative;

    min-width: 0;

    min-height: 64px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 3px;

    padding: 7px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);

    text-align: center;

    cursor: pointer;

    transition:
        transform .18s ease,
        border-color .18s ease,
        background-color .18s ease,
        box-shadow .18s ease;
}

.choice-card:hover {
    transform: translateY(-1px);

    border-color: var(--mint-border);
}

.choice-card strong {
    display: block;

    font-size: 10px;

    line-height: 1.2;
}

.choice-card small {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 9px;

    line-height: 1.2;
}

.choice-card:has(input:checked) {
    border-color: var(--primary);

    background: var(--mint);

    box-shadow:
        0 0 0 1px var(--primary);
}


/* ============================================================
   GOAL
============================================================ */

.goal-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 7px;
}

.choice-card.compact {
    min-height: 38px;

    flex-direction: row;

    padding: 7px;
}

.choice-card.compact span {
    font-size: 11px;

    font-weight: 600;
}


/* ============================================================
   TRAINER MODE
============================================================ */

.trainer-section {
    grid-column: 1 / -1;

    padding: 10px 0 0;

    border: 0;

    box-shadow: none;

    background: transparent;
}

.trainer-controls {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 10px 12px;

    align-items: end;
}

.trainer-control {
    min-width: 0;
}

.trainer-control small {
    display: block;

    margin: 0 0 5px;

    color: var(--muted);

    font-size: 9px;
}

.trainer-control > input[type="number"] {
    width: 100%;
}

.adjustment-input {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        76px;

    gap: 6px;

    width: 100%;
}

.adjustment-input select {
    width: 100%;
    min-width: 0;
}

.trainer-percent {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        22px;

    min-width: 0;
}

.trainer-percent input {
    width: 100%;
    min-width: 0;

    border-radius: 8px 0 0 8px;
}

.trainer-percent span {
    display: flex;

    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-left: 0;

    border-radius: 0 8px 8px 0;

    background: var(--input-bg);

    color: var(--muted);

    font-size: 10px;
}

.trainer-note {
    margin: 8px 0 0;

    padding: 7px 9px;

    border: 1px solid var(--mint-border);

    border-radius: 7px;

    background: var(--mint);

    color: var(--muted);

    font-size: 10px;
}

.trainer-note strong {
    color: var(--primary-dark);
}


/* ============================================================
   BUTTONS
============================================================ */

button {
    border: 0;

    border-radius: 8px;

    background: var(--primary);

    color: white;

    font-size: 12px;
    font-weight: 700;

    transition:
        transform .18s ease,
        background-color .18s ease,
        box-shadow .18s ease;
}

button:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(15, 175, 143, .18);
}

button:active {
    transform: translateY(0);
}

button:focus-visible {
    outline: 3px solid var(--focus);

    outline-offset: 2px;
}

form > button {
    width: 100%;

    margin-top: 4px;

    padding: 9px 14px;
}

.form-message {
    min-height: 15px;

    margin: 5px 0 0;

    color: var(--error);

    font-size: 10px;

    text-align: center;
}

.privacy-note {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 9px;

    text-align: center;
}


/* ============================================================
   RESULTS — INITIAL EMPTY STATE
============================================================ */

/*
   IMPORTANT:
   The existing HTML has `hidden` on .results-card.
   We intentionally make the empty result area visible here.
   The real values remain hidden until JavaScript adds .has-results.
*/

.results-card[hidden] {
    display: block !important;

    min-height: 280px;
}

.results-card[hidden] > * {
    display: none;
}

.results-card[hidden]::before {
    content:
        "Your Daily Targets\A\AComplete the calculator to see your calories, BMI, macros and daily habit targets.";

    min-height: 245px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    border: 1px dashed var(--border);
    border-radius: 10px;

    background: var(--input-bg);
    color: var(--muted);

    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;

    text-align: center;
    white-space: pre-line;
}

/* ============================================================
   RESULTS
============================================================ */

.results-header h2 {
    font-size: 18px;
}

.results-header p {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 10px;
}

.calorie-highlight {
    margin-top: 9px;

    padding: 11px 12px;

    border: 1px solid var(--mint-border);

    border-radius: 9px;

    background: var(--mint);
}

.calorie-highlight h3 {
    margin: 0;

    color: var(--primary-dark);

    font-size: 11px;
}

.calorie-value {
    display: flex;

    align-items: baseline;

    gap: 5px;
}

.calorie-highlight output {
    font-size: 25px;

    font-weight: 800;
}

.calorie-value span {
    color: var(--muted);

    font-size: 10px;
}

.calorie-highlight p {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 9px;
}

.metric-grid,
.macros,
.targets-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 7px;
}

.metric-grid {
    margin-top: 7px;
}

.metric-card,
.macro-card,
.target-card {
    min-width: 0;

    border: 1px solid var(--border);

    border-radius: 8px;
}

.metric-card {
    padding: 9px;
}

.metric-card h3 {
    margin: 0 0 3px;

    color: var(--muted);

    font-size: 10px;
}

.metric-card output {
    display: inline-block;

    font-size: 17px;

    font-weight: 800;
}

.metric-card p {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 9px;
}

.macronutrient-section,
.daily-targets,
.calculation-details {
    margin-top: 9px;

    padding-top: 8px;

    border-top: 1px solid var(--border);
}

.results-subheading h3 {
    margin: 0;

    font-size: 12px;
}

.results-subheading p {
    margin: 2px 0 6px;

    color: var(--muted);

    font-size: 9px;
}

.macro-card {
    padding: 9px;
}

.macro-card span {
    display: block;

    margin-bottom: 3px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;
}

.macro-card output {
    font-size: 17px;

    font-weight: 800;
}

.macro-card.protein {
    background: var(--protein-bg);
}

.macro-card.carbs {
    background: var(--carbs-bg);
}

.macro-card.fat {
    background: var(--fat-bg);
}

.target-card {
    display: flex;

    align-items: center;

    gap: 7px;

    padding: 8px;

    background: var(--input-bg);
}

.target-card > span {
    font-size: 16px;
}

.target-card strong {
    display: block;

    font-size: 10px;
}

.target-card output {
    display: block;

    margin-top: 1px;

    font-size: 12px;

    font-weight: 700;
}

.calculation-details summary {
    cursor: pointer;

    font-size: 11px;

    font-weight: 700;
}

.details-content {
    margin-top: 7px;

    border: 1px solid var(--border);

    border-radius: 8px;

    overflow: hidden;
}

.details-content div {
    display: flex;

    justify-content: space-between;

    gap: 10px;

    padding: 6px 9px;

    border-bottom: 1px solid var(--border);

    font-size: 9px;
}

.details-content div:last-child {
    border-bottom: 0;
}

.details-content span {
    color: var(--muted);
}

.results-disclaimer {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 8px;

    line-height: 1.4;
}


/* ============================================================
   PROGRESS PAGE
============================================================ */

.progress-page-heading {
    margin-bottom: 14px;
}

.progress-page-heading h2 {
    margin: 0;

    font-size: 24px;

    line-height: 1.2;
}

.progress-page-heading p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 11px;
}

.progress-section {
    margin-bottom: 14px;
}


/* ============================================================
   PROGRESS OVERVIEW
============================================================ */

.progress-overview-strip {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 8px;

    margin-top: 10px;
}

.progress-counter {
    min-width: 0;

    padding: 8px 10px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--input-bg);
}

.progress-counter strong {
    display: block;

    font-size: 16px;

    font-weight: 800;
}

.progress-counter span {
    color: var(--muted);

    font-size: 9px;
}

.progress-date strong {
    font-size: 13px;
}


/* ============================================================
   PROGRESS DATE SELECTOR
============================================================ */

.progress-date-row {
    display: flex;

    align-items: end;

    gap: 12px;

    margin-top: 10px;

    padding: 9px 10px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--surface);
}

.date-picker-field {
    width: 150px;

    flex: 0 0 150px;
}

.date-helper {
    margin: 0;

    color: var(--muted);

    font-size: 9px;

    line-height: 1.35;
}


/* ============================================================
   TODAY'S PROGRESS
============================================================ */

.today-progress-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(0, .85fr);

    gap: 10px;

    margin-top: 10px;
}

.today-progress-card {
    min-width: 0;

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--surface);
}

.today-card-heading {
    margin-bottom: 10px;
}

.today-card-heading h3 {
    margin: 0;

    font-size: 13px;
}

.today-card-heading p {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 9px;
}

.today-form-grid {
    display: grid;

    grid-template-columns:
        minmax(105px, .65fr)
        minmax(130px, 1fr)
        minmax(130px, 1fr);

    gap: 10px;

    align-items: start;
}

.weight-input-wrapper {
    display: flex;

    align-items: center;

    gap: 7px;

    width: max-content;

    max-width: 100%;
}

.weight-input-wrapper input {
    width: 78px;

    min-width: 78px;

    max-width: 78px;
}

.weight-unit {
    color: var(--text);

    font-size: 11px;

    font-weight: 600;
}

.history-choice-group {
    display: flex;

    align-items: center;

    gap: 10px;

    min-height: 34px;
}

.history-choice {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    color: var(--text);

    font-size: 10px;

    cursor: pointer;
}

.history-notes {
    margin-top: 9px;
}

.history-notes textarea {
    min-height: 52px;
}

.entry-actions {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-top: 9px;
}

.history-save-button,
.secondary-button {
    width: auto;

    margin: 0;

    padding: 8px 12px;
}

.secondary-button {
    border: 1px solid var(--border);

    background: var(--input-bg);

    color: var(--text);
}

.secondary-button:hover {
    background: var(--mint);

    color: var(--primary-dark);
}

.save-message {
    min-height: 14px;

    margin: 6px 0 0;

    font-size: 9px;
}

.save-message.success {
    color: var(--success);
}

.save-message.error {
    color: var(--error);
}


/* ============================================================
   TODAY SUMMARY
============================================================ */

.today-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 7px;
}

.today-summary-item {
    min-width: 0;

    padding: 9px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--input-bg);
}

.today-summary-item span {
    display: block;

    color: var(--muted);

    font-size: 9px;
}

.today-summary-item strong {
    display: block;

    margin-top: 3px;

    font-size: 16px;

    font-weight: 800;
}

.today-summary-item small {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 8px;

    line-height: 1.3;
}


/* ============================================================
   TRENDS
============================================================ */

.progress-trends-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;

    margin-top: 10px;
}

.progress-trend-card {
    min-width: 0;

    padding: 11px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--surface);
}

.progress-card-heading {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 8px;
}

.progress-card-heading h3 {
    margin: 0;

    font-size: 12px;
}

.progress-card-heading p {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 9px;
}

.small-control {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: auto;

    padding: 5px 9px;

    border: 1px solid var(--border);

    border-radius: 7px;

    background: var(--input-bg);

    color: var(--muted);

    font-size: 10px;
}

.chart-placeholder {
    min-height: 82px;

    display: grid;

    place-items: center;

    margin-top: 9px;

    padding: 8px;

    border: 1px dashed var(--border);

    border-radius: 8px;

    background: var(--input-bg);

    color: var(--muted);

    text-align: center;

    font-size: 9px;
}


/* ============================================================
   CUSTOM HISTORY
============================================================ */

.custom-history-card {
    margin-top: 10px;

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--surface);
}

.custom-history-card h3 {
    margin: 0;

    font-size: 12px;
}

.custom-history-card p {
    margin: 2px 0 9px;

    color: var(--muted);

    font-size: 9px;
}

.custom-history-controls {
    display: grid;

    grid-template-columns:
        150px
        150px;

    gap: 9px;
}

.custom-history-card > .secondary-button {
    margin-top: 9px;
}

.history-result {
    margin-top: 8px;

    padding: 7px 9px;

    border-radius: 7px;

    background: var(--input-bg);

    color: var(--muted);

    font-size: 9px;
}


/* ============================================================
   FOOTER
============================================================ */

footer {
    padding: 8px 20px 16px;

    text-align: center;

    color: var(--muted);

    font-size: 9px;
}


/* ============================================================
   RESULT ANIMATION
============================================================ */

@keyframes resultReveal {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-card.has-results .calorie-highlight,
.results-card.has-results .metric-card,
.results-card.has-results .macro-card,
.results-card.has-results .target-card {
    animation:
        resultReveal .32s ease both;
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 1100px) {

    .personal-grid {
        grid-template-columns:
            70px
            minmax(120px, 1fr)
            82px;
            
        gap: 10px;
    }

    .personal-grid .field:nth-child(4) {
        grid-column: 1 / -1;
    }

    .height-controls {
        width: 100%;
    }
}


@media (max-width: 1000px) {

    main.calculator-main {
        grid-template-columns: 1fr;

        width:
            min(760px, calc(100% - 24px));
    }

    .progress-main {
        width:
            min(900px, calc(100% - 24px));
    }

    .trainer-controls {
        grid-template-columns:
            1fr
            1fr;
    }

    .activity-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}


/* ============================================================
   MOBILE / SMALL TABLET
============================================================ */

@media (max-width: 700px) {

    .site-header {
        padding: 12px 14px;
    }

    .brand {
        flex-wrap: wrap;
    }

    .brand-copy {
        flex: 1 1 auto;
    }

    .main-nav {
        order: 3;

        width: 100%;

        margin-left: 0;

        justify-content: center;

        padding-top: 7px;

        border-top: 1px solid var(--border);
    }

    .theme-toggle {
        margin-left: auto;
    }

    .personal-grid {
        grid-template-columns:
            1fr
            1fr;
    }

    .personal-grid .field:nth-child(4) {
        grid-column: 1 / -1;
    }

    .progress-overview-strip {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .today-progress-grid,
    .progress-trends-grid {
        grid-template-columns: 1fr;
    }

    .progress-date-row {
        flex-direction: column;

        align-items: stretch;
    }

    .date-picker-field {
        width: 100%;

        flex: 1 1 auto;
    }

    .custom-history-controls {
        grid-template-columns:
            1fr
            1fr;
    }
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 600px) {

    main.calculator-main,
    .progress-main {
        width: calc(100% - 16px);

        margin-top: 10px;
    }

    section {
        padding: 12px;
    }

    .brand h1 {
        font-size: 17px;
    }

    .brand p {
        font-size: 10px;
    }

    .main-nav a {
        padding: 6px 8px;

        font-size: 10px;
    }

    .theme-toggle {
        padding: 5px 8px;

        font-size: 10px;
    }

    .personal-grid,
    .trainer-controls,
    .today-form-grid {
        grid-template-columns: 1fr;
    }

    .personal-grid .field:nth-child(4) {
        grid-column: auto;
    }

    .height-controls {
        grid-template-columns:
            minmax(0, 1fr)
            58px
            58px;
    }

    .height-controls:has(#Centimeters:not([hidden])) {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(100px, 1fr);
    }

    .height-controls select {
        min-width: 0;
    }

    .activity-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .goal-grid,
    .metric-grid,
    .macros,
    .targets-grid,
    .today-summary-grid,
    .progress-overview-strip {
        grid-template-columns: 1fr;
    }

    .mode-options {
        flex-direction: column;
    }

    .custom-history-controls {
        grid-template-columns: 1fr;
    }

    .entry-actions {
        flex-wrap: wrap;
    }
}


/* ============================================================
   REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration: .01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: .01ms !important;
    }
}

/* =========================
   PROGRESS CHARTS
========================= */

.chart-container {
    position: relative;

    width: 100%;
    height: 260px;

    margin-top: 18px;

    overflow: hidden;
}


.chart-container canvas {
    display: block;

    width: 100%;
    height: 100%;
}


/* =========================
   TREND SUMMARY
========================= */

.trend-summary {
    margin: 12px 0 0;

    color: var(--muted);

    font-size: 14px;
}


.trend-summary strong {
    color: var(--text);

    font-size: 16px;
}


/* =========================
   RESPONSIVE CHARTS
========================= */

@media (max-width: 650px) {

    .chart-container {
        height: 220px;
    }

}
/* ============================================================
   Email Verification
   ============================================================ */

.verification-login-button {
    display: none;
    margin-top: 24px;
    padding: 12px 24px;

    background-color: var(--primary);
    color: #ffffff;

    text-decoration: none;
    font-weight: 600;

    border-radius: 8px;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.verification-login-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
/* ============================================================
   DNC V2 — UI REFINEMENT
   Compact layout + yellow accent + visual polish
============================================================ */

:root {
    --primary: #F4B400;
    --primary-dark: #D99500;

    --mint: #FFF7D6;
    --mint-border: #F3D77A;

    --focus: rgba(244, 180, 0, 0.20);

    --success: #178A5B;

    --accent-dark: #172033;
    --accent-soft: #FFFBEA;

    --shadow:
        0 3px 14px rgba(16, 24, 40, 0.055);
}

html[data-theme="dark"] {
    --primary: #FFC928;
    --primary-dark: #E7A900;

    --mint: #3A3217;
    --mint-border: #66551A;

    --focus: rgba(255, 201, 40, 0.22);

    --success: #45C58A;

    --accent-dark: #F2F6FA;
    --accent-soft: #2F2A18;
}


/* ============================================================
   HEADER
============================================================ */

.site-header {
    padding: 10px 24px;
}

.brand {
    gap: 9px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;

    background: transparent;
    color: var(--primary);

    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand h1 {
    font-size: 18px;
    letter-spacing: -0.2px;
}

.main-nav a {
    transition:
        background-color .18s ease,
        color .18s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--mint);
    color: var(--primary-dark);
}

.theme-toggle {
    border-radius: 8px;
}


/* ============================================================
   MAIN CONTAINERS
============================================================ */

main.calculator-main,
.progress-main {
    margin-top: 12px;
}

section {
    border-radius: 11px;
    padding: 12px;
}

.section-heading {
    gap: 8px;
    margin-bottom: 6px;
}

.section-number {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;

    background: var(--primary);
    color: #172033;

    font-size: 11px;
}


/* ============================================================
   MODE
============================================================ */

.mode-options {
    gap: 8px;
    margin-top: 10px;
}

.mode-option span {
    padding: 8px 12px;
}

.mode-option input:checked + span {
    border-color: var(--primary);

    background: var(--mint);

    color: var(--accent-dark);

    box-shadow:
        0 0 0 1px var(--primary);
}


/* ============================================================
   FORM COMPACTNESS
============================================================ */

fieldset {
    padding: 8px 0;
}

legend {
    margin-bottom: 6px;
}

input[type="number"],
input[type="date"],
select {
    height: 32px;
    padding: 5px 7px;
    border-radius: 7px;
}


/* ============================================================
   HEIGHT CONTROLS
============================================================ */

/*
   Desktop:
   selector remains useful-sized,
   numeric values remain compact.
*/

.height-controls {
    grid-template-columns:
        minmax(110px, 1fr)
        88px;
    gap: 6px;
}

.height-controls:has(#Feet:not([hidden])) {
    grid-template-columns:
        minmax(105px, 1fr)
        58px
        58px;
}

.height-controls:has(#Centimeters:not([hidden])) {
    grid-template-columns:
        minmax(110px, 1fr)
        88px;
}

.height-controls input {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
}

.height-controls:has(#Centimeters:not([hidden])) #Centimeters {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
}


/* ============================================================
   ACTIVITY / GOAL CARDS
============================================================ */

.activity-grid {
    gap: 6px;
}

.choice-card {
    min-height: 60px;
    padding: 6px;
    border-radius: 8px;
}

.choice-card:hover {
    transform: translateY(-1px);
}

.choice-card:has(input:checked) {
    border-color: var(--primary);

    background: var(--mint);

    box-shadow:
        0 0 0 1px var(--primary),
        0 2px 8px rgba(244, 180, 0, 0.10);
}

.choice-card.compact {
    min-height: 36px;
}


/* ============================================================
   MAIN ACTION BUTTON
============================================================ */

form > button {
    margin-top: 6px;
    padding: 10px 14px;

    background: var(--primary);
    color: #172033;

    font-weight: 800;

    box-shadow:
        0 3px 10px rgba(244, 180, 0, 0.16);
}

form > button:hover {
    background: var(--primary-dark);
    color: #ffffff;
}


/* ============================================================
   SMALL VISUAL GRAPHICS
============================================================ */

.results-header h2::before {
    content: "🥗";

    display: inline-block;

    margin-right: 7px;

    font-size: 17px;
}

.macronutrient-section .results-subheading h3::before {
    content: "⚡";

    display: inline-block;

    margin-right: 5px;
}

.daily-targets .results-subheading h3::before {
    content: "🎯";

    display: inline-block;

    margin-right: 5px;
}


/* ============================================================
   RESULTS
============================================================ */

.calorie-highlight {
    border-color: var(--mint-border);
    background:
        linear-gradient(
            135deg,
            var(--mint),
            var(--accent-soft)
        );
}

.calorie-highlight h3 {
    color: var(--primary-dark);
}

.metric-card,
.macro-card,
.target-card {
    border-radius: 8px;
}

.metric-card:hover,
.macro-card:hover,
.target-card:hover {
    border-color: var(--mint-border);
}


/* ============================================================
   EMPTY RESULTS GRAPHIC
============================================================ */

.results-card[hidden] {
    min-height: 260px;
}

.results-card[hidden]::before {
    content:
        "🥗\A\AYour Daily Targets\A\AComplete the calculator to see your calories, BMI, macros and daily habit targets.";

    min-height: 225px;

    background:
        linear-gradient(
            135deg,
            var(--input-bg),
            var(--accent-soft)
        );

    font-size: 12px;
}


/* ============================================================
   TRAINER MODE
============================================================ */

.trainer-note {
    border-color: var(--mint-border);
    background: var(--mint);
}

.trainer-note strong {
    color: var(--primary-dark);
}


/* ============================================================
   MOBILE — IMPORTANT HEIGHT FIX
============================================================ */

@media (max-width: 600px) {

    .site-header {
        padding: 9px 12px;
    }

    main.calculator-main,
    .progress-main {
        width: calc(100% - 12px);
        margin-top: 8px;
    }

    section {
        padding: 10px;
        border-radius: 10px;
    }

    .section-heading {
        margin-bottom: 5px;
    }

    section h2 {
        font-size: 16px;
    }

    .section-description {
        font-size: 10px;
    }

    /*
       Keep personal fields compact rather than making
       every field full-width.
    */

    .personal-grid {
        grid-template-columns:
            72px
            minmax(0, 1fr);
        gap: 8px;
    }

    .personal-grid .field:nth-child(3),
    .personal-grid .field:nth-child(4) {
        grid-column: 1 / -1;
    }

    /*
       HEIGHT:
       Never split the available mobile width 50/50.
       The selector gets a controlled width and the
       numeric field stays compact.
    */

    .height-controls {
        width: 100%;

        grid-template-columns:
            120px
            88px;

        justify-content: start;

        gap: 6px;
    }

    .height-controls:has(#Centimeters:not([hidden])) {
        grid-template-columns:
            120px
            88px;
    }

    .height-controls:has(#Feet:not([hidden])) {
        grid-template-columns:
            100px
            58px
            58px;
    }

    .height-controls:has(#Centimeters:not([hidden])) #Centimeters {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
    }

    .height-controls input {
        width: 58px;
        min-width: 58px;
        max-width: 58px;
    }

    /*
       Activity cards stay compact.
    */

    .activity-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 5px;
    }

    .choice-card {
        min-height: 56px;
        padding: 5px;
    }

    .choice-card strong {
        font-size: 10px;
    }

    .choice-card small {
        font-size: 8px;
    }

    /*
       Goal cards remain on one row.
    */

    .goal-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 5px;
    }

    .choice-card.compact {
        min-height: 36px;
        padding: 5px;
    }

    .choice-card.compact span {
        font-size: 10px;
    }

    .mode-options {
        gap: 6px;
    }

    .mode-option span {
        padding: 8px 9px;
    }

    form > button {
        padding: 9px 12px;
    }

    .results-card[hidden]::before {
        min-height: 200px;
    }
}


/* ============================================================
   VERY SMALL PHONES
============================================================ */

@media (max-width: 380px) {

    .site-header {
        padding-left: 9px;
        padding-right: 9px;
    }

    .brand h1 {
        font-size: 15px;
    }

    .brand p {
        font-size: 9px;
    }

    .main-nav a {
        padding: 5px 6px;
        font-size: 9px;
    }

    .height-controls {
        grid-template-columns:
            110px
            82px;
    }

    .height-controls:has(#Feet:not([hidden])) {
        grid-template-columns:
            92px
            54px
            54px;
    }

    .height-controls:has(#Centimeters:not([hidden])) #Centimeters {
        width: 82px;
        min-width: 82px;
        max-width: 82px;
    }

    .activity-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}
/* ============================================================
   DNC V2 — FINAL THEME + FORM OVERRIDE
   IMPORTANT:
   Keep this block at the VERY END of style.css.
============================================================ */


/* ============================================================
   1. FINAL LIGHT THEME
============================================================ */

:root {
    --bg: #F6F8FB;
    --surface: #FFFFFF;

    --text: #172033;
    --muted: #667085;

    --primary: #F4B400;
    --primary-dark: #D99500;

    --mint: #FFF7D6;
    --mint-border: #F3D77A;

    --border: #E4E7EC;
    --input-bg: #FBFCFE;

    --error: #D92D20;
    --success: #178A5B;

    --focus: rgba(244, 180, 0, 0.20);

    --accent-dark: #172033;
    --accent-soft: #FFFBEA;

    --shadow:
        0 3px 14px rgba(16, 24, 40, 0.055);

    /* Chart colors */
    --chart-weight: #F4B400;
    --chart-bmi: #5B8DEF;
    --chart-bmr: #8B5CF6;
    --chart-calories: #0FAF8F;
    --chart-protein: #4F8EF7;
    --chart-carbs: #45A76B;
    --chart-fat: #D9822B;
    --chart-grid: #E4E7EC;
    --chart-label: #667085;
}


/* ============================================================
   2. FINAL DARK THEME
============================================================ */

html[data-theme="dark"] {

    --bg: #10141C;
    --surface: #181E29;

    --text: #F2F4F7;
    --muted: #A8B0BF;

    --primary: #FFC928;
    --primary-dark: #E7A900;

    --mint: #302A17;
    --mint-border: #66551A;

    --border: #303846;
    --input-bg: #202733;

    --error: #FF6B6B;
    --success: #45C58A;

    --focus: rgba(255, 201, 40, 0.24);

    --accent-dark: #F2F4F7;
    --accent-soft: #272317;

    --shadow:
        0 4px 18px rgba(0, 0, 0, 0.30);

    /* Dark chart colors */
    --chart-weight: #FFC928;
    --chart-bmi: #79A7FF;
    --chart-bmr: #B08CFF;
    --chart-calories: #39D6B0;
    --chart-protein: #79A7FF;
    --chart-carbs: #65C98A;
    --chart-fat: #F0A35B;
    --chart-grid: #394250;
    --chart-label: #A8B0BF;
}


/* ============================================================
   3. PAGE BACKGROUND
============================================================ */

html,
body {
    background: var(--bg) !important;
    color: var(--text) !important;
}

body {
    color-scheme: light;
}

html[data-theme="dark"] body {
    color-scheme: dark;
}


/* ============================================================
   4. GLOBAL TEXT
============================================================ */

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
legend,
strong,
span {
    color: inherit;
}

.section-description,
.brand p,
.results-header p,
.results-subheading p,
.privacy-note,
.trend-summary,
.field small,
.choice-card small,
.mode-text small {
    color: var(--muted);
}


/* ============================================================
   5. HEADER
============================================================ */

.site-header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text) !important;
}

.brand,
.brand-copy,
.brand h1,
.brand p {
    color: var(--text) !important;
}

.brand h1 span {
    color: var(--primary) !important;
}

.main-nav a {
    color: var(--text) !important;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--mint) !important;
    color: var(--primary-dark) !important;
}

.theme-toggle {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}

.theme-toggle:hover {
    background: var(--mint) !important;
    border-color: var(--primary) !important;
}


/* ============================================================
   6. MAIN CARDS / SECTIONS
============================================================ */

section,
.calculator-card,
.results-card,
.progress-card,
.auth-card,
.card,
.trainer-section {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}


/* ============================================================
   7. FORM CONTROLS
============================================================ */

input,
select,
textarea {
    background: var(--input-bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--primary) !important;
}

input:focus,
select:focus,
textarea:focus {
    background: var(--input-bg) !important;
    color: var(--text) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--focus) !important;
    outline: none !important;
}


/* Browser autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--text) !important;
    box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    border-color: var(--border) !important;
}


/* ============================================================
   8. MALE / FEMALE — COMPACT RADIO BUTTONS
============================================================ */

/*
   Do NOT make the gender choices look like large cards.
   They should remain small inline controls.
*/

.radio-group.inline-options {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}


/* Each gender option */

.radio-group.inline-options .radio-option {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    width: auto !important;
    min-width: 0 !important;

    min-height: 0 !important;
    height: auto !important;

    padding: 5px 9px !important;
    margin: 0 !important;

    border: 1px solid var(--border) !important;
    border-radius: 7px !important;

    background: var(--input-bg) !important;
    color: var(--text) !important;

    font-size: 12px !important;
    font-weight: 500 !important;

    cursor: pointer;
}


/* Actual radio */

.radio-group.inline-options .radio-option input[type="radio"] {
    width: 14px !important;
    height: 14px !important;

    min-width: 14px !important;
    min-height: 14px !important;

    margin: 0 6px 0 0 !important;

    padding: 0 !important;

    accent-color: var(--primary);

    box-shadow: none !important;
}


/* Selected Male/Female */

.radio-group.inline-options .radio-option:has(input:checked) {
    background: var(--mint) !important;
    border-color: var(--primary) !important;
    color: var(--text) !important;

    box-shadow:
        0 0 0 1px var(--primary) !important;
}


/* Remove card-like effects */

.radio-group.inline-options .radio-option:hover {
    transform: none !important;
    background: var(--mint) !important;
    border-color: var(--primary) !important;
}


/* ============================================================
   9. CALCULATION MODE
============================================================ */

.mode-option span {
    background: var(--input-bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.mode-option input:checked + span {
    background: var(--mint) !important;
    border-color: var(--primary) !important;
    color: var(--text) !important;
}


/* ============================================================
   10. ACTIVITY / GOAL CARDS
============================================================ */

.choice-card {
    background: var(--input-bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.choice-card strong,
.choice-card span {
    color: inherit !important;
}

.choice-card small {
    color: var(--muted) !important;
}

.choice-card:hover {
    background: var(--mint) !important;
    border-color: var(--primary) !important;
}

.choice-card:has(input:checked) {
    background: var(--mint) !important;
    border-color: var(--primary) !important;
    color: var(--text) !important;

    box-shadow:
        0 0 0 1px var(--primary) !important;
}


/* ============================================================
   11. SECTION NUMBERS
============================================================ */

.section-number {
    background: var(--primary) !important;
    color: #172033 !important;
}


/* ============================================================
   12. BUTTONS
============================================================ */

button,
.calculator-submit,
.auth-button {
    background: var(--primary);
    color: #172033;
    border-color: var(--primary);
}

button:hover,
.calculator-submit:hover,
.auth-button:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

html[data-theme="dark"] button,
html[data-theme="dark"] .calculator-submit,
html[data-theme="dark"] .auth-button {
    color: #172033;
}


/* ============================================================
   13. RESULTS
============================================================ */

.calorie-highlight {
    background:
        linear-gradient(
            135deg,
            var(--mint),
            var(--accent-soft)
        ) !important;

    border-color: var(--mint-border) !important;
}

.calorie-highlight h3 {
    color: var(--primary-dark) !important;
}

.metric-card,
.macro-card,
.target-card {
    background: var(--input-bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.metric-card:hover,
.macro-card:hover,
.target-card:hover {
    border-color: var(--mint-border) !important;
}


/* ============================================================
   14. TRAINER NOTE
============================================================ */

.trainer-note {
    background: var(--mint) !important;
    border-color: var(--mint-border) !important;
    color: var(--text) !important;
}

.trainer-note strong {
    color: var(--primary-dark) !important;
}


/* ============================================================
   15. PROGRESS / HISTORY
============================================================ */

.progress-overview-strip,
.today-progress-grid,
.progress-trends-grid,
.custom-history-section,
.today-progress-card,
.trend-card,
.history-card,
.progress-entry-card {
    color: var(--text);
}

.progress-main article,
.progress-main .card,
.progress-main section {
    background: var(--surface);
    border-color: var(--border);
}


/* ============================================================
   16. CHART AREA
============================================================ */

.chart-container {
    background: transparent !important;
}

.trend-summary strong {
    color: var(--text) !important;
}

.trend-summary {
    color: var(--muted) !important;
}


/* ============================================================
   17. DETAILS / CALCULATION DETAILS
============================================================ */

.calculation-details,
.calculation-details summary,
.details-content {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}


/* ============================================================
   18. AUTH PAGES
============================================================ */

.auth-main {
    color: var(--text) !important;
}

.auth-header h2,
.auth-header p {
    color: var(--text) !important;
}

.auth-header p {
    color: var(--muted) !important;
}

.auth-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

.auth-field label {
    color: var(--text) !important;
}

.auth-footer,
.auth-footer p {
    color: var(--muted) !important;
}

.auth-footer a,
.forgot-password-link a {
    color: var(--primary-dark) !important;
}


/* ============================================================
   19. FORM MESSAGES
============================================================ */

.form-message,
.auth-message {
    color: var(--muted);
}

.form-message.error,
.auth-message.error {
    color: var(--error) !important;
}

.form-message.success,
.auth-message.success {
    color: var(--success) !important;
}


/* ============================================================
   20. FOOTER
============================================================ */

footer,
.site-footer {
    background: var(--surface) !important;
    color: var(--muted) !important;
    border-color: var(--border) !important;
}


/* ============================================================
   21. DARK MODE — FORCE COMMON WHITE BACKGROUNDS OFF
============================================================ */

html[data-theme="dark"] .calculator-card,
html[data-theme="dark"] .results-card,
html[data-theme="dark"] section,
html[data-theme="dark"] article,
html[data-theme="dark"] .card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .macro-card,
html[data-theme="dark"] .target-card,
html[data-theme="dark"] .choice-card,
html[data-theme="dark"] .mode-option span,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}


/* Inputs need slightly different dark surface */

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .choice-card,
html[data-theme="dark"] .mode-option span {
    background-color: var(--input-bg) !important;
}


/* Selected controls */

html[data-theme="dark"] .choice-card:has(input:checked),
html[data-theme="dark"] .mode-option input:checked + span,
html[data-theme="dark"] .radio-option:has(input:checked) {
    background-color: var(--mint) !important;
}


/* ============================================================
   22. MOBILE GENDER CONTROLS
============================================================ */

@media (max-width: 600px) {

    .radio-group.inline-options {
        gap: 7px !important;
    }

    .radio-group.inline-options .radio-option {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }

    .radio-group.inline-options .radio-option input[type="radio"] {
        width: 13px !important;
        height: 13px !important;
        min-width: 13px !important;
        min-height: 13px !important;
        margin-right: 5px !important;
    }
}


/* ============================================================
   23. FINAL DARK BORDER NORMALIZATION
============================================================ */

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .radio-option,
html[data-theme="dark"] .choice-card,
html[data-theme="dark"] .mode-option span,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .macro-card,
html[data-theme="dark"] .target-card,
html[data-theme="dark"] .auth-card {
    border-color: var(--border) !important;
}


/* ============================================================
   END OF FINAL OVERRIDE
============================================================ */