/* ------------------------------
   RESET
------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 3px;
}

/* ------------------------------
   DESIGN SYSTEM
------------------------------- */
main {
    display: block;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background: linear-gradient(180deg, #d9f2fb 0%, #fffafb 48%, #f5a9b8 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

/* ------------------------------
   TYPOGRAPHY
------------------------------- */
body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    transition: background-color var(--transition-medium), color var(--transition-medium);
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--color-text); }
h1 { font-size: 36px; letter-spacing: 1px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin-bottom: 1rem; }
a { color: var(--color-text); transition: color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); }
a:hover { color: var(--color-text); }
.text-center { text-align: center; }
.text-small { font-size: var(--font-size-small); }
.text-medium { font-size: var(--font-size-medium); }
.text-large { font-size: var(--font-size-large); }
.text-hero { font-size: var(--font-size-hero); }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-text);
    color: #ffffff;
    padding: 0.75rem 1rem;
    z-index: 1000;
    border-radius: 0 0 10px 0;
}

.skip-link:focus {
    left: 0;
}

.site-banner {
    background: rgba(245, 231, 183, 0.9);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.94rem;
    font-weight: 700;
    padding: 0.7rem 1rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
}

.accessibility-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    opacity: 0.9;
}

.accessibility-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.theme-toggle,
.colorblind-toggle,
.reset-accessibility {
    border: 1px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    min-height: 44px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.site-note {
    max-width: 740px;
    margin: 1rem auto 0;
    font-size: 0.95rem;
    text-align: center;
    opacity: 0.88;
}

.policy-note,
.form-status {
    font-size: 0.9rem;
    line-height: 1.5;
}

.policy-note {
    margin: 0 0 1rem;
    opacity: 0.9;
}

.policy-note a,
.form-status a,
.legal-page a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.form-status {
    min-height: 1.5em;
    margin: 1rem 0 0;
    font-weight: 600;
}

.form-status.error {
    color: var(--color-error);
}

.form-status.success {
    color: var(--color-text);
}

/* ------------------------------
   DARK MODE COMPONENT OVERRIDES
------------------------------- */
body.dark-mode .top-bar,
body.dark-mode .theme-toggle,
body.dark-mode .colorblind-toggle,
body.dark-mode .reset-accessibility,
body.dark-mode .business-name,
body.dark-mode .content-card,
body.dark-mode .service-toggle,
body.dark-mode .service-description,
body.dark-mode .consultation-box,
body.dark-mode .contact-fields {
    background-color: rgba(27, 36, 49, 0.92);
    color: var(--color-text);
}

body.dark-mode .top-bar {
    background-color: #1d3b4b;
    border-color: #5e9bb5;
}

body.dark-mode .theme-toggle,
body.dark-mode .colorblind-toggle,
body.dark-mode .reset-accessibility {
    background-color: #315d70;
    border-color: #9ed8eb;
    color: #ffffff;
}

body.dark-mode .theme-toggle:hover,
body.dark-mode .theme-toggle:focus-visible,
body.dark-mode .colorblind-toggle:hover,
body.dark-mode .colorblind-toggle:focus-visible,
body.dark-mode .reset-accessibility:hover,
body.dark-mode .reset-accessibility:focus-visible {
    background-color: #477d92;
    color: #ffffff;
}

body.dark-mode .highlight-block,
body.dark-mode .highlight-block .professional-title,
body.dark-mode .highlight-block .tagline,
body.dark-mode .highlight-block .invitation-question,
body.dark-mode .highlight-block .subpage-title {
    color: #111111;
}

body.dark-mode .site-banner {
    background: rgba(183, 167, 107, 0.18);
}

body.dark-mode .btn-landing,
body.dark-mode .btn,
body.dark-mode .btn-back {
    background-color: var(--color-accent);
    color: var(--color-text);
}

body.dark-mode .btn-landing {
    background-color: #f5a9b8;
    color: #111111;
    border-color: #ffd9e1;
}

body.dark-mode .btn-landing:hover,
body.dark-mode .btn-landing:focus-visible {
    background-color: #ffffff;
    color: #111111;
    border-color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------
   DARK + COLORBLIND READABILITY (Task 5)
   In dark+colorblind mode, --color-accent resolves to #dfe9f8 and --color-text
   to #f2f7ff, producing light text on light-background elements. Literal hex is
   required here because the variable references resolve to the wrong values in
   this mode. These are additive overrides; no existing rule is modified.
------------------------------- */
body.dark-mode.colorblind-mode .btn-back,
body.dark-mode.colorblind-mode .btn-consultation {
    background-color: #f5a9b8;
    color: #1d2d2a;
}

body.dark-mode.colorblind-mode:not(.subpage) .business-name {
    color: #f2f7ff;
}

/* .category-header keeps a LIGHT fixed gradient in every theme, so its ink is
   always the fixed dark literal (see components.css); this override just makes
   that explicit against the combined-mode rule above. */
body.dark-mode.colorblind-mode .category-header {
    color: #1d2d2a;
}

/* Operator-granted scope exception: in dark-only mode .btn-back text is
   near-white on pink (1.67:1). This rule also matches in dark+colorblind, where
   it agrees with the combined-mode rule above. */
body.dark-mode .btn-back {
    color: #1d2d2a;
}
