/* Self-hosted fonts (latin subset), so visitors' IPs never go to Google (#515) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Zilla Slab';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/zilla-slab-600.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Zilla Slab';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/zilla-slab-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* FroggyDIY brand tokens (pond green, lily-pad yellow). Bootstrap 5.3 reads these, so components pick them up without a Sass build.
   Every text/background pair is checked for WCAG AA in both themes. */
:root, [data-bs-theme=light] {
    --fx-brand: #4D7C0F;
    --fx-brand-hover: #3F6212;
    --fx-on-brand: #fff;
    --fx-pond: #134E4A;
    --fx-yellow: #FACC15;

    --bs-primary: var(--fx-brand);
    --bs-primary-rgb: 77, 124, 15;
    --bs-link-color: var(--fx-brand);
    --bs-link-color-rgb: 77, 124, 15;
    --bs-link-hover-color: var(--fx-brand-hover);
    --bs-link-hover-color-rgb: 63, 98, 18;
    --bs-body-bg: #FAF8F5;
    --bs-body-bg-rgb: 250, 248, 245;
    --bs-body-color: #1C1917;
    --bs-body-color-rgb: 28, 25, 23;
    --bs-emphasis-color: #1C1917;
    --bs-secondary-color: rgba(28, 25, 23, 0.72);
    --bs-tertiary-bg: #FFFFFF;
    --bs-tertiary-bg-rgb: 255, 255, 255;
    --bs-border-color: #E7E1D8;
    --bs-success: #15803D;
    --bs-success-rgb: 21, 128, 61;
    --bs-danger: #B91C1C;
    --bs-danger-rgb: 185, 28, 28;
    --bs-warning: var(--fx-yellow);
    --bs-warning-rgb: 250, 204, 21;
    --bs-info: var(--fx-pond);
    --bs-info-rgb: 19, 78, 74;
    --bs-card-bg: #FFFFFF;
    --bs-font-sans-serif: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-border-radius: 0.5rem;
    --fx-heading-font: "Zilla Slab", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-bs-theme=dark] {
    --fx-brand: #A3E635;
    --fx-brand-hover: #BEF264;
    --fx-on-brand: #1C1917;
    --fx-pond: #5EEAD4;

    --bs-primary: var(--fx-brand);
    --bs-primary-rgb: 163, 230, 53;
    --bs-link-color: var(--fx-brand);
    --bs-link-color-rgb: 163, 230, 53;
    --bs-link-hover-color: var(--fx-brand-hover);
    --bs-link-hover-color-rgb: 190, 242, 100;
    --bs-body-bg: #1C1917;
    --bs-body-bg-rgb: 28, 25, 23;
    --bs-body-color: #F5F5F4;
    --bs-body-color-rgb: 245, 245, 244;
    --bs-emphasis-color: #FFFFFF;
    --bs-secondary-color: rgba(245, 245, 244, 0.72);
    --bs-tertiary-bg: #292524;
    --bs-tertiary-bg-rgb: 41, 37, 36;
    --bs-border-color: #44403C;
    --bs-success: #4ADE80;
    --bs-success-rgb: 74, 222, 128;
    --bs-danger: #F87171;
    --bs-danger-rgb: 248, 113, 113;
    --bs-info: var(--fx-pond);
    --bs-info-rgb: 94, 234, 212;
    --bs-success-text-emphasis: #4ADE80;
    --bs-danger-text-emphasis: #F87171;
    --bs-card-bg: #292524;
}

/* Selected list item (Ask Froggy chat, #406): brand green, not Bootstrap blue. */
.list-group {
    --bs-list-group-active-color: var(--fx-on-brand);
    --bs-list-group-active-bg: var(--fx-brand);
    --bs-list-group-active-border-color: var(--fx-brand);
}

.card { --bs-card-bg: var(--bs-tertiary-bg); }

/* Compiled .btn-primary/.btn-outline-primary don't follow --bs-primary, so wire them up here. */
.btn-primary {
    --bs-btn-color: var(--fx-on-brand);
    --bs-btn-bg: var(--fx-brand);
    --bs-btn-border-color: var(--fx-brand);
    --bs-btn-hover-color: var(--fx-on-brand);
    --bs-btn-hover-bg: var(--fx-brand-hover);
    --bs-btn-hover-border-color: var(--fx-brand-hover);
    --bs-btn-active-color: var(--fx-on-brand);
    --bs-btn-active-bg: var(--fx-brand-hover);
    --bs-btn-active-border-color: var(--fx-brand-hover);
    --bs-btn-disabled-color: var(--fx-on-brand);
    --bs-btn-disabled-bg: var(--fx-brand);
    --bs-btn-disabled-border-color: var(--fx-brand);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--fx-brand);
    --bs-btn-border-color: var(--fx-brand);
    --bs-btn-hover-color: var(--fx-on-brand);
    --bs-btn-hover-bg: var(--fx-brand);
    --bs-btn-hover-border-color: var(--fx-brand);
    --bs-btn-active-color: var(--fx-on-brand);
    --bs-btn-active-bg: var(--fx-brand-hover);
    --bs-btn-active-border-color: var(--fx-brand-hover);
    --bs-btn-disabled-color: var(--fx-brand);
    --bs-btn-disabled-border-color: var(--fx-brand);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

/* Reminder rows stay readable on wide screens (#402). */
.reminder-list { max-width: 48rem; }

/* Compiled outline colors fail AA on the dark background; use the themed tokens instead. */
.btn-outline-secondary {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-secondary-color);
    --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-hover-bg: var(--bs-secondary-bg);
    --bs-btn-hover-border-color: var(--bs-secondary-color);
    --bs-btn-active-color: var(--bs-body-color);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-border-color: var(--bs-secondary-color);
}

.btn-outline-danger {
    --bs-btn-color: var(--bs-danger);
    --bs-btn-border-color: var(--bs-danger);
    --bs-btn-hover-color: var(--bs-body-bg);
    --bs-btn-hover-bg: var(--bs-danger);
    --bs-btn-hover-border-color: var(--bs-danger);
    --bs-btn-active-color: var(--bs-body-bg);
    --bs-btn-active-bg: var(--bs-danger);
    --bs-btn-active-border-color: var(--bs-danger);
}

h1, h2, h3, h4, h5, h6, .fx-wordmark {
    font-family: var(--fx-heading-font);
    font-weight: 700;
}

/* The tinted callout lowers the outline button below 4.5:1; use the darker hover green (#397). */
.callout-call .btn-outline-primary {
    --bs-btn-color: var(--fx-brand-hover);
    --bs-btn-border-color: var(--fx-brand-hover);
}

/* Inline code, e.g. 2FA recovery codes (#235): Bootstrap's pink is 4.2:1 on our background; pond teal passes AA in both themes. */
code {
    color: var(--fx-pond);
}

h1, h2, .fx-wordmark {
    color: var(--fx-pond);
}

[data-bs-theme=dark] .fx-wordmark {
    color: #FAF8F5;
}

.fx-wordmark {
    font-size: 1.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.fx-wordmark-diy { color: var(--fx-brand); }

.fx-wordmark svg {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--fx-brand);
}

.text-success { color: var(--bs-success) !important; }

/* Urgency colors, shared by every page that shows a fix (see UrgencyBadge.razor). */
/* A label, not a button (#185): smaller and lighter than Bootstrap's bold badge. */
.urgency-badge { font-size: .7rem; font-weight: 500; }
/* Badges after a fix title (#590, #609): one even gap from the flex row (whitespace between them is ignored), and wrapped rows don't touch. */
.fix-badges { display: inline-flex; flex-wrap: wrap; gap: .3rem .25rem; margin: .15rem 0; }
.urgency-emergency { background-color: var(--bs-danger); color: #fff; }
[data-bs-theme=dark] .urgency-emergency { color: #1C1917; }
.urgency-high { background-color: var(--fx-yellow); color: #1C1917; }
.urgency-medium { background-color: var(--fx-pond); color: #fff; }
[data-bs-theme=dark] .urgency-medium { color: #1C1917; }
.urgency-low { background-color: var(--bs-secondary-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color); }

:focus-visible {
    outline: 2px solid var(--fx-brand);
    outline-offset: 2px;
}

.btn:focus-visible, .form-control:focus, .form-check-input:focus, .form-select:focus {
    border-color: var(--fx-brand);
    box-shadow: 0 0 0 0.1rem var(--bs-body-bg), 0 0 0 0.25rem var(--fx-brand);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--bs-success);
}

.invalid {
    outline: 1px solid var(--bs-danger);
}

.validation-message {
    color: var(--bs-danger);
}

.blazor-error-boundary {
    background: var(--bs-danger);
    padding: 1rem;
    color: #fff;
    border-radius: var(--bs-border-radius);
}

    .blazor-error-boundary::after {
        content: "Something went wrong here. Try reloading the page."
    }

.darker-border-checkbox.form-check-input {
    border-color: var(--bs-secondary-color);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Big rows on /more. */
.more-row {
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
}

/* ---- Compiled Bootstrap pieces that still use Bootstrap blue or fail AA in dark mode ---- */
.btn-danger {
    --bs-btn-color: var(--bs-body-bg);
    --bs-btn-bg: var(--bs-danger);
    --bs-btn-border-color: var(--bs-danger);
    --bs-btn-hover-color: var(--bs-body-bg);
    --bs-btn-hover-bg: var(--bs-danger);
    --bs-btn-hover-border-color: var(--bs-body-color);
    --bs-btn-active-color: var(--bs-body-bg);
    --bs-btn-active-bg: var(--bs-danger);
    --bs-btn-active-border-color: var(--bs-body-color);
}

.text-bg-primary { color: var(--fx-on-brand) !important; }
[data-bs-theme=dark] .text-bg-danger { color: #1C1917 !important; } /* white on #F87171 is ~2.9:1 */
.text-secondary { color: var(--bs-secondary-color) !important; }

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--fx-brand);
    --bs-nav-pills-link-active-color: var(--fx-on-brand);
}

/* Unchecked boxes need a 3:1 edge against the card (WCAG 1.4.11). */
.form-check-input { border-color: var(--bs-secondary-color); }

.form-check-input:checked {
    background-color: var(--fx-brand);
    border-color: var(--fx-brand);
}

.progress { --bs-progress-bar-bg: var(--fx-brand); }

/* Fields stand out from the page: raised fill (white in light mode) and a 3:1 edge (WCAG 1.4.11). */
.form-control, .form-select {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-secondary-color);
}

.form-control:focus { background-color: var(--bs-tertiary-bg); }

.form-floating > .form-control:not(:disabled) ~ label::after,
.form-floating > .form-select:not(:disabled) ~ label::after { background-color: var(--bs-tertiary-bg); }

/* Disabled fields (e.g. Username): Bootstrap's grey fill and label fail AA in dark mode; use a dashed edge instead. */
.form-control:disabled {
    background-color: var(--bs-body-bg);
    border-style: dashed;
}

.form-floating > .form-control:disabled ~ label { color: var(--bs-secondary-color); }
.form-floating > .form-control:disabled ~ label::after { background-color: transparent; }

/* ---- Account pages (AccountLayout and ManageLayout wrap them in .account) ---- */
.account hr { display: none; }

/* Template subtitles like "Create a new account." read as a lead line, not a heading block. */
.account h2 {
    font-family: var(--bs-body-font-family);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
}

.account h3 { font-size: 1.35rem; margin-bottom: 1rem; }
/* Login's second "OR" (the Google block's heading) looks like the first, a plain body-font line (#413). */
.account .or-divider { font-family: var(--bs-body-font-family); font-size: 1rem; font-weight: 400; }
/* Google / Facebook buttons (ExternalLoginPicker): brand colors, not the site green. */
.btn-provider {
    display: flex; align-items: center; justify-content: center; gap: .75rem;
    font-weight: 500; border: 1px solid transparent;
}
.btn-provider-google { background: #fff; color: #1f1f1f; border-color: #747775; }
.btn-provider-google:hover, .btn-provider-google:focus-visible { background: #f2f2f2; color: #1f1f1f; border-color: #747775; }
.btn-provider-facebook { background: #1877f2; color: #fff; }
.btn-provider-facebook:hover, .btn-provider-facebook:focus-visible { background: #166fe5; color: #fff; }
.account h4 { font-size: 1.1rem; }
/* Manage pages: h1 Account > h2 page title > h3 section (#410), same sizes as the old h3/h4. */
.account-manage h2 { font-family: var(--fx-heading-font); font-size: 1.35rem; font-weight: 700; color: inherit; margin-bottom: 1rem; }
.account-manage h3 { font-size: 1.1rem; }

/* A form holding only hidden inputs (Email send-verification form) is not a card, or it shows as an empty box. */
.account form:not(:has(:not(input[type=hidden]))) { display: none; }

/* Each form or side section becomes a card. */
.account .row > [class*="col-"] > :is(section, form) {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Narrow cards: the right-aligned floating placeholder collides with the label, so show it only while typing. */
.account .form-floating > .form-control:not(:focus)::placeholder { color: transparent; }

/* Show-password eye (#194), added by App.razor's script after each password box. */
.form-control:has(+ .password-eye) { padding-right: 3rem; }
.password-eye {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    width: 3rem;
    height: calc(3.5rem + 2 * var(--bs-border-width));
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    font-size: 1.25rem;
}

    .password-eye:hover { color: var(--bs-body-color); }

/* Manage nav: a column on wide screens, a scrolling row of pills on phones. */
.account-manage .nav-pills {
    --bs-nav-link-color: var(--bs-body-color);
    --bs-nav-link-hover-color: var(--fx-brand);
    gap: 0.25rem;
}

    .account-manage .nav-pills .nav-link {
        white-space: nowrap;
        min-height: 2.75rem;
        display: flex;
        align-items: center;
    }

@media (max-width: 991.98px) {
    .account-manage .nav-pills {
        overflow-x: auto;
        scrollbar-width: none;
        /* Edge fades hint at the tabs off screen (#401, #551); padding lets the first and last tabs scroll clear of them. */
        padding-inline: 2.5rem;
        mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
    }
    .account-manage .nav-pills .nav-link:not(.active) { border: 1px solid var(--bs-border-color); }
}

/* Settings forms (Profile, Notifications): titled sections, 44px switch rows and theme buttons. */
.account legend {
    font-family: var(--fx-heading-font);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.account .form-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding-left: 0;
    margin: 0.25rem 0;
}

    .account .form-switch .form-check-input { float: none; margin: 0; flex-shrink: 0; width: 2.5em; height: 1.25em; }
    .account .form-switch .form-check-label { flex: 1; padding-block: 0.4rem; }
    .account .form-check-label .form-text { display: block; margin-top: 0; }

/* A setting that belongs to the switch above it shows only while that switch is on. */
.account .form-switch:not(:has(:checked)) + .switch-detail { display: none; }

.account .btn-check + .btn { --bs-btn-padding-y: 0.6rem; }

/* ---- Phones (#71) ---- */
/* Long words, emails and URLs in user and AI text wrap instead of widening the page. */
/* List rows too (#232): Home "Next up" and the Saturday plan list fix titles outside a card body. */
.card-body, .list-group-item { overflow-wrap: anywhere; }

/* iOS Safari zooms into any field under 16px, including .form-control-sm. */
@media (max-width: 767.98px) {
    .form-control, .form-select { font-size: max(1rem, 16px); }
}

/* Touch screens: small buttons get a ~44px tap target. Mouse users keep the compact size. */
@media (pointer: coarse) {
    .btn-sm {
        --bs-btn-padding-y: 0.65rem;
        min-width: 2.75rem;
    }
}

/* Guest log-out warning (#350): native <details>, no marker */
.guest-logout > summary { list-style: none; cursor: pointer; }
.guest-logout > summary::-webkit-details-marker { display: none; }

/* In-app navigation progress (#523): a thin bar along the top while a slow page load (e.g. waking after idle) is on the way.
   Toggled by js/site.js; the element is in App.razor. */
.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2000;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
}
.nav-progress.active { visibility: visible; }
.nav-progress::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    background: var(--bs-primary);
    animation: nav-progress 1.1s ease-in-out infinite;
}
@keyframes nav-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
    .nav-progress::before { width: 100%; animation: none; opacity: .7; }
}

/* Before the circuit connects (#442) buttons on interactive pages can't work yet: show it. See Fixly.lib.module.js. */
body.blazor-wait button, body.blazor-wait .photo-button, body.blazor-wait label.btn {
    pointer-events: none;
    opacity: .6;
}

/* Who do I call? (#446): chips and the placeholder need AA contrast; the Ask button stays full strength. */
.who-chip {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-body-color);
}
.who-form .form-control::placeholder { color: var(--bs-secondary-color); font-style: italic; }
.who-form .btn-primary:disabled { opacity: 1; }
.you-asked { color: var(--bs-secondary-color); margin: 1rem 0 0; }
.who-zip-row { max-width: 22rem; }
.who-zip-row .btn { flex: none; }

/* #507: the guest Terms line under the header Get started button stays narrow */
