/* ============================================================
   SAGE Compass — Stylesheet v2.0.0
   Azimuth Partners Ltd
   Lora (serif) / DM Sans (sans)
   Accent: #FD7014
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ── Full-width breakout
   Overrides the theme's content column width and background.
   For best results, assign a Full Width page template in your theme.
   ────────────────────────────────────────────────────────── */
.sage-app {
    --orange:        #FD7014;
    --orange-soft:   #fff5ee;
    --orange-mid:    #fcd9bc;
    --ink:           #1b1b1b;
    --ink-mid:       #484848;
    --ink-light:     #888;
    --border:        #e6e1d9;
    --bg:            #f8f6f2;
    --white:         #ffffff;
    --radius:        14px;
    --radius-sm:     9px;
    --shadow:        0 1px 16px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
    --shadow-lg:     0 4px 40px rgba(0,0,0,0.09), 0 0 0 1px rgba(0,0,0,0.04);
    --transition:    0.18s ease;

    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.7;
    background: var(--white);

    /* Break out of theme content column */
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 48px 24px 96px;
    box-sizing: border-box;
}

/* ── Screens ──────────────────────────────────────────────── */
.sage-screen { display: none; }
.sage-screen.active {
    display: block;
    animation: sageIn 0.32s ease both;
}
@keyframes sageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Card ─────────────────────────────────────────────────── */
.sage-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 52px 52px 44px;
    max-width: 660px;
    margin: 0 auto;
}
.sage-card--welcome  { text-align: center; padding-top: 60px; padding-bottom: 56px; }
.sage-card--centered { text-align: center; padding: 80px 52px; }

/* ── Custom icon ──────────────────────────────────────────── */
.sage-custom-icon {
    margin: 0 auto 28px;
    max-width: 80px;
}
.sage-custom-icon img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Welcome typography ───────────────────────────────────── */
.sage-title {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 8px;
}
.sage-tagline {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.13em;
    margin-bottom: 32px;
}
.sage-intro-text {
    text-align: left;
    max-width: 540px;
    margin: 0 auto 36px;
    font-size: 0.97rem;
    color: var(--ink-mid);
    line-height: 1.78;
}
.sage-intro-text p { margin-bottom: 14px; }
.sage-intro-text p:last-child { margin-bottom: 0; }

/* ── Stage selector ───────────────────────────────────────── */
.sage-stage-group { margin-bottom: 32px; }
.sage-stage-group > .sage-label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--ink-mid);
}
.sage-stage-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sage-stage-btn {
    width: 100%;
    padding: 15px 20px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.97rem;
    font-weight: 400;
    color: var(--ink-mid);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition), font-weight var(--transition);
}
.sage-stage-btn:hover    { border-color: var(--orange-mid); color: var(--ink); }
.sage-stage-btn.selected {
    border-color: var(--orange);
    background: var(--orange-soft);
    color: var(--ink);
    font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────────── */
.sage-btn {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.93rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 30px;
    transition: background var(--transition), color var(--transition), opacity var(--transition), border-color var(--transition);
    line-height: 1;
}
.sage-btn--primary {
    background: var(--orange);
    color: var(--white);
}
.sage-btn--primary:hover:not(:disabled) { background: #e36210; }
.sage-btn--primary:disabled { opacity: 0.38; cursor: not-allowed; }
.sage-btn--ghost {
    background: transparent;
    color: var(--ink-mid);
    border: 1.5px solid var(--border);
}
.sage-btn--ghost:hover { border-color: #bbb; color: var(--ink); }
.sage-btn--sm { padding: 10px 20px; font-size: 0.84rem; }

.sage-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* ── Progress bar ─────────────────────────────────────────── */
.sage-progress-bar {
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 40px;
    overflow: hidden;
}
.sage-progress-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 2px;
    transition: width 0.45s ease;
}

/* ── Privacy notice ───────────────────────────────────────── */
.sage-privacy-notice {
    background: var(--orange-soft);
    border-left: 3px solid var(--orange);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 20px 22px;
    margin-bottom: 28px;
}
.sage-privacy-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 10px;
}
.sage-privacy-body p {
    font-size: 0.87rem;
    color: var(--ink-mid);
    margin-bottom: 8px;
    line-height: 1.65;
}
.sage-privacy-body p:last-child { margin-bottom: 0; }
.sage-privacy-body a { color: var(--orange); text-decoration: underline; }

/* ── Lead form ────────────────────────────────────────────── */
.sage-lead-form { display: flex; flex-direction: column; gap: 18px; }
.sage-field-group { display: flex; flex-direction: column; gap: 6px; }
.sage-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
}
.sage-required { color: var(--orange); }
.sage-input {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--white);
    transition: border-color var(--transition);
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.sage-input:focus { border-color: var(--orange); }
.sage-input::placeholder { color: #c2bdb5; }
.sage-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.87rem;
    color: var(--ink-mid);
    cursor: pointer;
    line-height: 1.55;
}
.sage-consent input[type="checkbox"] {
    accent-color: var(--orange);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

/* ── Card title ───────────────────────────────────────────── */
.sage-card-title {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 24px;
    line-height: 1.25;
}

/* ── Quadrant header ──────────────────────────────────────── */
.sage-quadrant-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 30px;
}
.sage-quadrant-badge {
    width: 46px;
    height: 46px;
    min-width: 46px;
    background: var(--orange);
    color: var(--white);
    font-family: 'Lora', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-top: 3px;
    flex-shrink: 0;
}
.sage-quadrant-meta .sage-card-title { margin-bottom: 4px; }
.sage-quadrant-subtitle {
    font-size: 0.84rem;
    color: var(--ink-light);
    line-height: 1.5;
}

/* ── Prompt items ─────────────────────────────────────────── */
.sage-prompts-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}
.sage-prompt-item {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}
.sage-prompt-item.answered { border-color: var(--orange-mid); }

.sage-prompt-text {
    padding: 15px 18px 12px;
    font-size: 0.93rem;
    color: var(--ink-mid);
    line-height: 1.65;
    /* No italics */
    font-style: normal;
    border-bottom: 1px solid var(--border);
}
.sage-prompt-options {
    display: flex;
}
.sage-response-btn {
    flex: 1;
    padding: 10px 5px;
    border: none;
    border-right: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.76rem;
    color: var(--ink-light);
    text-align: center;
    transition: background var(--transition), color var(--transition);
    line-height: 1.35;
}
.sage-response-btn:last-child { border-right: none; }
.sage-response-btn:hover {
    background: var(--orange-soft);
    color: var(--ink);
}
.sage-response-btn.selected {
    background: var(--orange);
    color: var(--white);
    font-weight: 500;
}

/* ── Open text ────────────────────────────────────────────── */
.sage-open-text-group { margin-top: 4px; }
.sage-hint {
    font-size: 0.82rem;
    color: var(--ink-light);
    margin: 4px 0 9px;
    line-height: 1.5;
}
.sage-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: var(--ink);
    background: var(--white);
    resize: vertical;
    min-height: 88px;
    transition: border-color var(--transition);
    outline: none;
    line-height: 1.65;
    box-sizing: border-box;
}
.sage-textarea:focus { border-color: var(--orange); }
.sage-textarea::placeholder { color: #c2bdb5; }

/* ── Generating screen ────────────────────────────────────── */
.sage-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 28px;
    animation: sageSpin 1.8s linear infinite;
}
.sage-spinner svg { width: 100%; height: 100%; }
@keyframes sageSpin { to { transform: rotate(360deg); } }

.sage-generating-label {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}
.sage-generating-sub {
    font-size: 0.9rem;
    color: var(--ink-light);
    transition: opacity 0.4s ease;
}

/* ── Results ──────────────────────────────────────────────── */
.sage-results-wrap {
    max-width: 1080px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.sage-results-header {
    padding: 32px 44px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.sage-results-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--orange);
    font-weight: 500;
    margin-bottom: 4px;
}
.sage-results-name {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}

/* Two-column layout */
.sage-results-panels {
    display: grid;
    grid-template-columns: 380px 1fr;
}
.sage-panel { padding: 36px 40px; }
.sage-panel--chart {
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sage-panel-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    width: 100%;
}

/* Chart — intentionally prominent */
.sage-chart-wrap {
    width: 100%;
    max-width: 310px;
    margin: 0 auto 24px;
}

.sage-chart-key {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    width: 100%;
    margin-bottom: 0;
}
.sage-key-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--ink-mid);
}
.sage-key-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    /* Colour set inline per quadrant */
}

/* Narrative panel */
.sage-panel--narrative {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sage-narrative-section { margin-bottom: 32px; }
.sage-narrative-text {
    font-size: 0.97rem;
    color: var(--ink-mid);
    line-height: 1.88;
}
.sage-narrative-text p { margin-bottom: 18px; }
.sage-narrative-text p:last-child { margin-bottom: 0; }

/* Coaching questions */
.sage-coaching-section {
    margin-top: 8px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.sage-panel-title--coaching { color: var(--ink); }
.sage-coaching-intro {
    font-size: 0.88rem;
    color: var(--ink-light);
    margin-bottom: 20px;
    line-height: 1.65;
    font-style: italic;
}
.sage-coaching-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: coaching-counter;
}
.sage-coaching-list li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    counter-increment: coaching-counter;
    padding: 16px 18px;
    background: var(--orange-soft);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--ink-mid);
    line-height: 1.7;
    border-left: 3px solid var(--orange);
}
.sage-coaching-list li::before {
    content: counter(coaching-counter);
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--orange);
    flex-shrink: 0;
    min-width: 18px;
    line-height: 1.7;
}

/* Thank-you text */
.sage-thankyou {
    margin-top: 28px;
    padding: 20px 22px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--ink-mid);
    line-height: 1.65;
}
.sage-thankyou p { margin-bottom: 8px; }
.sage-thankyou p:last-child { margin-bottom: 0; }

/* Results footer */
.sage-results-footer {
    margin-top: auto;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
}
.sage-footer-text {
    font-size: 0.8rem;
    color: var(--ink-light);
    line-height: 1.6;
}
.sage-footer-text p { margin-bottom: 4px; }
.sage-footer-text p:last-child { margin-bottom: 0; }
.sage-footer-text a { color: var(--orange); text-decoration: none; }

.sage-consent--optional {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--ink-light);
}
.sage-error {
    background: #fff5f5;
    border: 1.5px solid #f5c6c6;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 0.88rem;
    color: #c0392b;
    margin-top: 20px;
    line-height: 1.5;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
    .sage-results-panels {
        grid-template-columns: 1fr;
    }
    .sage-panel--chart {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sage-chart-wrap {
        max-width: 280px;
    }
    .sage-results-header { padding: 24px 28px; }
    .sage-panel { padding: 28px; }
}

@media (max-width: 600px) {
    .sage-app { padding: 24px 12px 72px; }
    .sage-card { padding: 28px 22px 24px; }
    .sage-card--welcome { padding: 36px 22px 32px; }
    .sage-card--centered { padding: 64px 22px; }
    .sage-nav {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .sage-btn { width: 100%; text-align: center; }
    .sage-response-btn { font-size: 0.7rem; padding: 9px 3px; }
    .sage-results-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .sage-results-header { padding: 20px; }
    .sage-panel { padding: 20px; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .sage-screen { display: none !important; }
    .sage-screen[data-screen="results"] { display: block !important; }

    .sage-app {
        width: 100%;
        left: 0;
        transform: none;
        padding: 0;
    }
    .sage-results-wrap { box-shadow: none; border: none; }
    .sage-results-header { background: none; }
    .sage-results-panels { grid-template-columns: 1fr; }
    .sage-panel--chart {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    .sage-chart-wrap { max-width: 260px; }
    .sage-btn--sm { display: none; }
}
