/* Parameter Odoo Score — frontend
   Mobile-first, dark/light aware via prefers-color-scheme.
   Brand tokens mirror parameterllc.com. */

/* Fixed light theme — site renders on a light background, so we don't honor
   prefers-color-scheme (it would flip text without flipping bg → invisible).
   Same approach as plugins/parameter-risk-score. */
.ods {
    --p-brand: #7A5AF8;
    --p-brand-700: #6B46F2;
    --p-brand-900: #4E2DE3;
    --p-text: #0F172A;
    --p-muted: #475569;
    --p-soft: #F6F7FF;
    --p-surface: #FFFFFF;
    --p-border: #E5E7EB;
    --p-radius: 16px;
    --p-radius-btn: 10px;
    --p-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    --p-container: 720px;

    --grade-a: #16a34a;
    --grade-b: #65a30d;
    --grade-c: #d97706;
    --grade-d: #ea580c;
    --grade-f: #dc2626;

    color: var(--p-text);
    font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.6;
    max-width: var(--p-container);
    margin: 0 auto;
    padding: 24px 20px;
}

.ods *, .ods *::before, .ods *::after { box-sizing: border-box; }

.ods__view { padding: 36px 0; }

.ods__brand {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--p-brand-900);
    margin: 0 0 10px;
    line-height: 1;
}
.ods__brand--persistent {
    font-size: 0.85rem;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--p-border);
    letter-spacing: 0.01em;
    text-transform: none;
}

.ods__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--p-brand-900);
    background: rgba(122, 90, 248, 0.08);
    border: 1px solid rgba(122, 90, 248, 0.22);
    padding: 5px 11px;
    border-radius: 999px;
    margin: 0 0 18px;
}

.ods__h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
    color: var(--p-text);
}
.ods__h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
    color: var(--p-text);
}

.ods__lead {
    font-size: 1rem;
    color: var(--p-muted);
    line-height: 1.65;
    margin: 0 0 24px;
}

/* Belt-and-suspenders: parent themes often style h1/h2/p inside .entry-content
   with higher specificity. Re-assert text colors on every text-bearing block. */
.ods .ods__view, .ods .ods__view * { color: var(--p-text); }
.ods .ods__lead, .ods .ods__q-help, .ods .ods__email-lead, .ods .ods__legal,
.ods .ods__notice, .ods .ods__rescan-line,
.ods .ods__progress-meta, .ods .ods__field span, .ods .ods__tier-name,
.ods .ods__calc-text { color: var(--p-muted); }
.ods .ods__brand, .ods .ods__eyebrow, .ods .ods__back, .ods .ods__link,
.ods .ods__answer-key, .ods .ods__legal a { color: var(--p-brand-900); }
.ods .ods__btn--primary, .ods .ods__btn--primary * { color: #fff !important; }
.ods .ods__grade-chip { color: #fff; }
.ods .ods__error { color: #b91c1c; }

/* Buttons ---------------------------------------------------------------- */
.ods__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: var(--p-radius-btn);
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 48px;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
/* !important needed to beat the theme's global a.btn { background-image: none !important } */
.ods .ods__btn--primary {
    background-image: linear-gradient(135deg, var(--p-brand-900), var(--p-brand)) !important;
    background-color: var(--p-brand-900) !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(78, 45, 227, 0.25) !important;
}
.ods .ods__btn--primary:hover { transform: translateY(-1px) !important; box-shadow: 0 12px 28px rgba(78, 45, 227, 0.30) !important; }
.ods .ods__btn--primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.ods .ods__btn--ghost {
    background-color: var(--p-surface) !important;
    background-image: none !important;
    color: var(--p-brand-900) !important;
    border-color: rgba(78, 45, 227, 0.22) !important;
}
.ods .ods__btn--ghost:hover { border-color: var(--p-brand) !important; background-color: var(--p-soft) !important; }

.ods__link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--p-brand-900);
    text-decoration: underline;
    font: inherit;
    cursor: pointer;
}

/* Trust strip + notice --------------------------------------------------- */
.ods__trust {
    list-style: none;
    margin: 22px 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ods__trust li { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--p-muted); }
.ods__check { color: #16a34a; font-weight: 800; }

.ods__notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 0;
    padding: 12px 14px;
    background: rgba(122, 90, 248, 0.05);
    border: 1px solid rgba(122, 90, 248, 0.18);
    border-radius: 10px;
    color: var(--p-text);
    font-size: 12.5px;
    line-height: 1.5;
    text-align: left;
}
.ods__notice-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--p-brand-900);
    margin-top: 1px;
}
.ods__notice-icon svg { width: 18px; height: 18px; display: block; }
.ods__notice-text { color: var(--p-muted); }

/* Quiz progress ---------------------------------------------------------- */
.ods__progress { margin: 0 0 22px; }
.ods__progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--p-muted);
    margin: 0 0 8px;
}
.ods__progress-bar {
    height: 6px;
    background: var(--p-border);
    border-radius: 999px;
    overflow: hidden;
}
.ods__progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--p-brand-900), var(--p-brand));
    transition: width .3s ease;
    border-radius: inherit;
}
.ods__back {
    background: none;
    border: 0;
    color: var(--p-brand-900);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 4px 0;
}

/* Question card ---------------------------------------------------------- */
.ods__q {
    animation: ods-slide-in .25s ease;
}
@keyframes ods-slide-in {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: none; }
}
.ods__q-label {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}
.ods__q-help { color: var(--p-muted); font-size: 0.92rem; margin: 0 0 18px; }
.ods__answers {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ods__answer {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--p-border);
    border-radius: 12px;
    background: var(--p-surface);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, transform .08s ease;
}
.ods__answer:hover {
    border-color: var(--p-brand);
    background: var(--p-soft);
}
.ods__answer.is-selected {
    border-color: var(--p-brand);
    background: var(--p-soft);
}
.ods__answer-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(122, 90, 248, 0.10);
    color: var(--p-brand-900);
    font-size: 12px;
    font-weight: 800;
}
.ods__answer.is-selected .ods__answer-key {
    background: var(--p-brand-900);
    color: #fff;
}
.ods__answer-text { font-size: 0.95rem; line-height: 1.5; color: var(--p-text); }
.ods__answer input { position: absolute; opacity: 0; pointer-events: none; }

.ods__q-actions { display: flex; gap: 10px; }

/* Calculating ------------------------------------------------------------ */
.ods__view--calc { text-align: center; padding: 60px 0; }
.ods__calc-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--p-border);
    border-top-color: var(--p-brand);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: ods-spin 0.9s linear infinite;
}
@keyframes ods-spin { to { transform: rotate(360deg); } }
.ods__calc-text { color: var(--p-muted); font-size: 0.95rem; }

/* Result ----------------------------------------------------------------- */
.ods__result-card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    box-shadow: var(--p-shadow);
    padding: 28px;
    margin: 0 0 22px;
    position: relative;
    overflow: hidden;
}
.ods__result-card::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--p-brand-900), var(--p-brand));
}
.ods__grade-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 8px 0 16px;
}
.ods__grade-chip {
    width: 78px;
    height: 78px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    background: var(--grade-c);
    flex-shrink: 0;
}
.ods__grade-chip[data-grade="A"] { background: var(--grade-a); }
.ods__grade-chip[data-grade="B"] { background: var(--grade-b); }
.ods__grade-chip[data-grade="C"] { background: var(--grade-c); }
.ods__grade-chip[data-grade="D"] { background: var(--grade-d); }
.ods__grade-chip[data-grade="F"] { background: var(--grade-f); }
.ods__grade-line { font-size: 1.4rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.ods__tier-name { font-size: 0.92rem; color: var(--p-muted); margin: 4px 0 0; font-weight: 700; }
.ods__verdict { font-size: 1rem; line-height: 1.6; margin: 0 0 18px; color: var(--p-text); }

.ods__cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.ods__cta-row .ods__cta-secondary {
    margin-top: 6px;
    font-size: 0.92rem;
    color: var(--p-muted);
    width: 100%;
}
.ods__cta-row .ods__cta-secondary a { color: var(--p-brand-900); text-decoration: underline; }

/* Email gate ------------------------------------------------------------- */
.ods__email-card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 26px;
    box-shadow: var(--p-shadow);
}
.ods__email-lead { color: var(--p-muted); font-size: 0.95rem; margin: 0 0 16px; }
.ods__email-form { display: flex; flex-direction: column; gap: 12px; }
.ods__field { display: flex; flex-direction: column; gap: 6px; }
.ods__field span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--p-muted);
}
.ods__field span em { font-style: normal; opacity: 0.7; text-transform: none; letter-spacing: 0; font-weight: 600; }
.ods__field input {
    font: inherit;
    font-size: 16px;
    padding: 12px 14px;
    border: 1px solid var(--p-border);
    border-radius: 10px;
    background: var(--p-surface);
    color: var(--p-text);
}
.ods__field input:focus {
    outline: none;
    border-color: var(--p-brand);
    box-shadow: 0 0 0 3px rgba(122, 90, 248, 0.18);
}
.ods__error {
    margin: 0;
    padding: 10px 12px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.22);
    color: #b91c1c;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}
.ods__legal { margin: 4px 0 0; font-size: 11px; color: var(--p-muted); }
.ods__legal a { color: var(--p-brand-900); }

.ods__email-thanks {
    background: rgba(22, 163, 74, 0.06);
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: var(--p-radius);
    padding: 26px;
}
.ods__email-thanks p { margin: 8px 0 0; }

.ods__rescan-line { margin: 22px 0 0; text-align: center; font-size: 0.9rem; }

/* v3 — reference code line under tier name */
.ods__ref-line { margin: 6px 0 0; font-size: 12px; color: var(--p-muted); }
.ods__ref-line code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    background: rgba(122, 90, 248, 0.10);
    color: var(--p-brand-900);
    padding: 2px 6px;
    border-radius: 4px;
}

/* v3 — Two-block tier-adaptive layout */
.ods__blocks {
    display: grid;
    gap: 22px;
    margin: 0 0 22px;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .ods__blocks:has(.ods__block--assessment:not([hidden])) {
        grid-template-columns: 1fr 1.15fr;
        align-items: start;
    }
}
.ods__block {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 24px;
    box-shadow: var(--p-shadow);
    position: relative;
}
.ods__block--primary {
    background: linear-gradient(180deg, rgba(122,90,248,0.06) 0%, var(--p-surface) 70%);
    border-color: rgba(122,90,248,0.22);
}
.ods__block--soft {
    background: var(--p-surface);
    opacity: 0.95;
}
.ods__block-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--p-muted);
    background: rgba(122,90,248,0.06);
    border: 1px solid rgba(122,90,248,0.16);
    padding: 3px 9px;
    border-radius: 999px;
    margin: 0 0 10px;
}
.ods__block--primary .ods__block-kicker {
    color: var(--p-brand-900);
    background: rgba(122,90,248,0.10);
    border-color: rgba(122,90,248,0.24);
}
.ods__assess-lead { color: var(--p-muted); margin: 0 0 16px; font-size: 0.95rem; line-height: 1.6; }

/* v3 — Closing block (D / F tiers, replaces Block B) */
.ods__block--closing {
    background: rgba(15, 23, 42, 0.03);
    border-style: dashed;
    border-color: var(--p-border);
}
.ods__closing-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--p-text);
    line-height: 1.65;
}

/* v3 — Assessment-request form (oar = "odoo assessment request") */
.oar { background: transparent; }
.oar__form { display: flex; flex-direction: column; gap: 12px; }
.oar__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .oar__row { grid-template-columns: 1fr; } }
.oar__field { display: flex; flex-direction: column; gap: 6px; }
.oar__field span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--p-muted);
}
.oar__field span em { font-style: normal; opacity: 0.7; text-transform: none; letter-spacing: 0; font-weight: 600; }
.oar__field input,
.oar__field textarea,
.oar__field select {
    font: inherit;
    font-size: 15px;
    padding: 11px 13px;
    border: 1px solid var(--p-border);
    border-radius: 10px;
    background: var(--p-surface);
    color: var(--p-text);
}
.oar__field textarea { resize: vertical; min-height: 80px; }
.oar__field input:focus,
.oar__field textarea:focus,
.oar__field select:focus {
    outline: none;
    border-color: var(--p-brand);
    box-shadow: 0 0 0 3px rgba(122, 90, 248, 0.18);
}
.oar__submit { margin-top: 4px; }
.oar__error {
    margin: 0;
    padding: 10px 12px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.22);
    color: #b91c1c;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}
.oar__micro { margin: 0; font-size: 12px; color: var(--p-muted); }
.oar__legal { margin: 0; font-size: 11px; color: var(--p-muted); }
.oar__legal a { color: var(--p-brand-900); }

.oar__thanks {
    background: rgba(22, 163, 74, 0.06);
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 12px;
    padding: 22px;
}
.oar__thanks code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    background: rgba(22,163,74,0.10);
    padding: 1px 6px;
    border-radius: 4px;
    color: #15803d;
}
.oar__thanks-next { margin: 8px 0 0; font-size: 0.9rem; color: var(--p-muted); }
.oar__h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; color: var(--p-text); }

/* When embedded as Block B (compact mode), the form sits inside an .ods__block —
   no need for its own background. */
.oar--compact .oar__form { gap: 10px; }

/* Mobile ----------------------------------------------------------------- */
@media (max-width: 480px) {
    .ods__view { padding: 24px 0; }
    .ods__h1 { font-size: 1.7rem; }
    .ods__grade-chip { width: 64px; height: 64px; font-size: 2rem; border-radius: 14px; }
    .ods__result-card, .ods__email-card, .ods__email-thanks { padding: 22px 18px; }
    .ods__answer { padding: 12px 14px; }
}
