/* DET-wide color theme. Loaded after page styles so every /det surface shares one preference. */

.det-theme-toggle {
    align-items: center;
    background: #f4f6f4;
    border: 1px solid #dfe5e1;
    border-radius: 999px;
    color: #2d5f4d;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    margin-right: .35rem;
    padding: 0;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
    width: 38px;
}

.det-theme-toggle:hover {
    background: rgba(45, 95, 77, .1);
    border-color: rgba(45, 95, 77, .32);
    transform: translateY(-1px);
}

.det-theme-toggle:focus,
.det-theme-toggle:focus-visible {
    outline: 2px solid #5c8a72;
    outline-offset: 2px;
}

.det-theme-icon {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 18px;
}

.det-theme-icon-sun {
    display: none;
}

html[data-det-theme="dark"] .det-theme-icon-moon {
    display: none;
}

html[data-det-theme="dark"] .det-theme-icon-sun {
    display: block;
}

html[data-det-theme="dark"],
html[data-det-theme="dark"] body {
    background: #101512 !important;
    color: #e8eee9 !important;
    color-scheme: dark !important;
}

html[data-det-theme="light"] {
    color-scheme: light;
}

/* DET navigation and the shared footer */
body.dark-mode .det-nav-header {
    background: #151c18;
    border-bottom-color: #2a3730;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .32);
}

body.dark-mode .det-nav-logo-text {
    background: linear-gradient(135deg, #b5d2bf 0%, #7fa87f 100%);
    background-clip: text;
    -webkit-background-clip: text;
}

body.dark-mode .det-nav-link,
body.dark-mode .det-user-btn,
body.dark-mode .det-account-menu-link,
body.dark-mode .det-mobile-menu > summary,
body.dark-mode .det-mobile-menu-link {
    color: #b9c5be;
}

body.dark-mode .det-nav-link:hover,
body.dark-mode .det-nav-link.active,
body.dark-mode .det-user-btn:hover,
body.dark-mode .det-user-btn.active,
body.dark-mode .det-account-menu[open] .det-user-btn,
body.dark-mode .det-account-menu-link:hover,
body.dark-mode .det-account-menu-link.active,
body.dark-mode .det-mobile-menu > summary:hover,
body.dark-mode .det-mobile-menu[open] > summary,
body.dark-mode .det-mobile-menu-link:hover,
body.dark-mode .det-mobile-menu-link.active {
    background: rgba(127, 168, 127, .13);
    color: #a9cfb1;
}

body.dark-mode .det-user-btn,
body.dark-mode .det-theme-toggle {
    background: #202a24;
    border-color: #34443b;
}

body.dark-mode .det-theme-toggle {
    color: #dbe8de;
}

body.dark-mode .det-theme-toggle:hover {
    background: #29372f;
    border-color: #62826d;
}

body.dark-mode .det-mobile-menu-panel {
    background: #18211c;
    border-color: #34443b;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
}

body.dark-mode .det-account-menu-panel {
    background: #18211c;
    border-color: #34443b;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
}

body.dark-mode .det-menu-divider {
    background: #34443b;
}

body.dark-mode .det-account-menu-link.det-logout-link,
body.dark-mode .det-mobile-menu-link.det-logout-link {
    color: #FCA5A5;
}

body.dark-mode .det-account-menu-link.det-logout-link:hover,
body.dark-mode .det-mobile-menu-link.det-logout-link:hover {
    background: rgba(248, 113, 113, .12);
    color: #FECACA;
}

body.dark-mode footer.bg-white {
    background: #121915 !important;
    border-color: #2a3730 !important;
}

body.dark-mode footer .text-gray-600,
body.dark-mode footer .text-gray-500 {
    color: #9caaa2 !important;
}

body.dark-mode footer .text-gray-400 {
    color: #829087 !important;
}

/* Marketing home */
body.dark-mode .det-page {
    background: linear-gradient(180deg, #101612 0%, #131a16 18%, #101512 100%);
    color: #d7dfd9;
}

body.dark-mode .det-hero::before {
    background:
        radial-gradient(circle at 12% 10%, rgba(127, 168, 127, .14), transparent 30%),
        radial-gradient(circle at 80% 8%, rgba(92, 111, 92, .13), transparent 32%);
}

body.dark-mode .det-hero-card,
body.dark-mode .det-petra-card {
    background: linear-gradient(180deg, #1c251f 0%, #171f1a 100%);
    border-color: #334039;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

body.dark-mode .det-hero-panel,
body.dark-mode .det-kicker,
body.dark-mode .det-section-label,
body.dark-mode .det-score-preview,
body.dark-mode .det-mini-card,
body.dark-mode .det-trust-stat,
body.dark-mode .det-card,
body.dark-mode .det-section-white {
    background: #19211c;
    border-color: #334039;
}

body.dark-mode .det-petra-avatar {
    background: #eef2ef;
    border-color: #4a5a51;
}

body.dark-mode .det-title,
body.dark-mode .det-section-title,
body.dark-mode .det-petra-name,
body.dark-mode .det-score-preview h3,
body.dark-mode .det-mini-value,
body.dark-mode .det-trust-stat strong,
body.dark-mode .det-card h3,
body.dark-mode .det-proof-card strong,
body.dark-mode .det-testimonial-text,
body.dark-mode .det-testimonial-name,
body.dark-mode .det-advisor-name {
    color: #f0f3f1;
}

body.dark-mode .det-subtitle,
body.dark-mode .det-score-row-top,
body.dark-mode .det-list li {
    color: #c4cec8;
}

body.dark-mode .det-trust-line,
body.dark-mode .det-petra-copy,
body.dark-mode .det-mini-label,
body.dark-mode .det-trust-stat span,
body.dark-mode .det-section-copy,
body.dark-mode .det-card p,
body.dark-mode .det-proof-card p,
body.dark-mode .det-disclaimer,
body.dark-mode .det-advisor-role {
    color: #9daaa2;
}

body.dark-mode .det-kicker,
body.dark-mode .det-section-label,
body.dark-mode .det-testimonial-score,
body.dark-mode .det-advisors-cta {
    color: #9bc49b;
}

body.dark-mode .det-score-bar {
    background: #344139;
}

body.dark-mode .det-btn-secondary {
    background: #202a24;
    border-color: #405047;
    color: #b6d2bd;
}

body.dark-mode .det-trust-row {
    border-top-color: #334039;
}

body.dark-mode .det-proof-card,
body.dark-mode .det-testimonial-card {
    background: linear-gradient(135deg, rgba(127, 168, 127, .1), rgba(127, 168, 127, .04));
    border-color: #345345;
}

body.dark-mode .det-advisor-photo {
    border-color: #425148;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

/* Pricing */
body.dark-mode .det-pricing-page {
    background: linear-gradient(180deg, #11171f 0%, #101512 100%);
    color: #e8eee9;
}

body.dark-mode .det-pricing-card {
    background: #19211c;
    border-color: #34443b;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}

body.dark-mode .det-pricing-title,
body.dark-mode .det-pricing-feature h2 {
    color: #f0f3f1;
}

body.dark-mode .det-pricing-copy,
body.dark-mode .det-pricing-feature p {
    color: #aab6af;
}

body.dark-mode .det-pricing-feature {
    background: #202a24;
    border-color: #34443b;
}

body.dark-mode .det-pricing-btn-secondary {
    background: #202a24;
    border-color: #405047;
    color: #8eb7ff;
}

/* Dashboard */
body.dark-mode .det-dashboard {
    --det-dash-ink: #e6ede9;
    --det-dash-muted: #a2b0a8;
    --det-dash-line: #34443b;
    --det-dash-soft: #202a24;
    --det-dash-paper: #19211c;
    --det-dash-green: #79b696;
    --det-dash-green-dark: #a8d5bc;
    --det-dash-mint: #22392f;
    --det-dash-blue: #223149;
    --det-dash-amber: #493d24;
    --det-dash-red: #ff8e7d;
    --det-dash-shadow: 0 18px 45px rgba(0, 0, 0, .25);
    background:
        radial-gradient(circle at 8% 0%, rgba(201, 239, 122, .08), transparent 28rem),
        linear-gradient(180deg, #111713 0%, #151d18 100%);
}

body.dark-mode .det-dashboard-error {
    background: #2b1e1b;
    border-color: #69433b;
}

body.dark-mode .det-dashboard-button-secondary {
    background: rgba(25, 33, 28, .8);
}

body.dark-mode .det-dashboard-button-secondary:hover {
    background: #253129;
}

body.dark-mode .det-dashboard-button-primary,
body.dark-mode .det-dashboard-goal-form button,
body.dark-mode .det-dashboard-focus-option input:checked + span {
    background: #356b55;
    border-color: #356b55;
    color: #fff;
}

body.dark-mode .det-dashboard-subscore-card,
body.dark-mode .det-dashboard-panel,
body.dark-mode .det-dashboard-task-table-wrap {
    background: rgba(25, 33, 28, .94);
    border-color: #34443b;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

body.dark-mode .det-dashboard-task-table th {
    background: #202a24;
}

body.dark-mode .det-dashboard-task-confidence[data-confidence="early"],
body.dark-mode .det-dashboard-task-confidence[data-confidence="developing"] {
    color: #f0d896;
}

body.dark-mode .det-dashboard-error-chip {
    background: #35231e;
    border-color: #6a4338;
    color: #efaa96;
}

/* Saved-result review */
html[data-det-theme="dark"].det-review-page,
html[data-det-theme="dark"].det-review-page body {
    background: #111713 !important;
}

body.dark-mode .det-review {
    --det-review-ink: #e6ede9;
    --det-review-muted: #a2b0a8;
    --det-review-green: #79b696;
    --det-review-green-dark: #a8d5bc;
    --det-review-mint: #22392f;
    --det-review-paper: #19211c;
    --det-review-soft: #202a24;
    --det-review-line: #34443b;
    --det-review-good: #74d59e;
    --det-review-warn: #e5b768;
    --det-review-bad: #ff8e8e;
}

body.dark-mode .det-review-hero {
    background:
        radial-gradient(circle at 8% 10%, rgba(127, 168, 127, .12), transparent 34%),
        linear-gradient(135deg, #1d2a23 0%, #19231e 52%, #17201b 100%);
    border-color: #365044;
}

body.dark-mode .det-review-evidence-pill,
body.dark-mode .det-review-meta span,
body.dark-mode .det-review-score-card {
    background: rgba(31, 43, 36, .9);
    border-color: #3c594b;
}

body.dark-mode .det-review-quality-note {
    background: #342b1c;
    border-color: #705e35;
}

body.dark-mode .det-review-quality-note strong {
    color: #f1cb78;
}

body.dark-mode .det-review-quality-note p {
    color: #cfb982;
}

body.dark-mode .correct .det-review-answer-state {
    background: #1f3b2b;
}

body.dark-mode .partial .det-review-answer-state {
    background: #40341f;
}

body.dark-mode .incorrect .det-review-answer-state {
    background: #402525;
}

body.dark-mode .det-review-criteria-row,
body.dark-mode .det-review-criterion-score-context {
    background: #1d2922;
}

body.dark-mode .det-review-criteria-track {
    background: #35433b;
}

body.dark-mode .det-review-feedback-card {
    background: linear-gradient(160deg, #1c2b23, #19211c 60%);
}

body.dark-mode .det-review-primary-action,
body.dark-mode .det-review-error button,
body.dark-mode .det-review-section-pill {
    background: #376f58;
    color: #fff;
}

@media (max-width: 560px) {
    .det-theme-toggle {
        flex-basis: 36px;
        height: 36px;
        margin-right: .1rem;
        width: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .det-theme-toggle {
        transition: none;
    }

    .det-theme-toggle:hover {
        transform: none;
    }
}
