/* Life Season Reading Engine - Public Styles */
:where(.lsre-quiz-container, .lsre-results-container, .lsre-journey-detail, .lsre-quiz-container * , .lsre-results-container * , .lsre-journey-detail *) {
    box-sizing: border-box;
}

:where(.lsre-quiz-container, .lsre-results-container, .lsre-journey-detail) {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
:root {
    --lsre-primary: #1f3a8a;
    --lsre-secondary: #0f766e;
    --lsre-accent: #f59e0b;
    --lsre-text: #0f172a;
    --lsre-muted: #475569;
    --lsre-bg: #ffffff;
    --lsre-surface: rgba(255,255,255,0.92);
    --lsre-border: rgba(15, 23, 42, 0.12);
    --lsre-shadow: 0 10px 30px rgba(2, 6, 23, 0.10);
    --lsre-shadow-soft: 0 6px 18px rgba(2, 6, 23, 0.08);
    --lsre-radius: 16px;
}

.lsre-quiz-container, .lsre-results-container, .lsre-journey-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    color: var(--lsre-text);
}

.lsre-results-container {
    padding-top: 1.25rem;
}

.lsre-quiz-container, .lsre-results-narrative, .lsre-recommendations, .lsre-journey-inline {
    background: var(--lsre-surface);
    border: 1px solid var(--lsre-border);
    border-radius: var(--lsre-radius);
    box-shadow: var(--lsre-shadow-soft);
    backdrop-filter: blur(6px);
}

.lsre-results-narrative, .lsre-recommendations, .lsre-journey-inline {
    padding: 1.5rem;
    margin-top: 1.25rem;
}

.lsre-brand-hero {
    border-radius: calc(var(--lsre-radius) + 6px);
    padding: 1.25rem;
    background: radial-gradient(1200px 500px at 20% 10%, rgba(245,158,11,0.22), transparent 55%),
                radial-gradient(900px 500px at 80% 10%, rgba(15,118,110,0.18), transparent 60%),
                linear-gradient(135deg, rgba(31,58,138,0.08), rgba(15,118,110,0.06));
    border: 1px solid var(--lsre-border);
    box-shadow: var(--lsre-shadow);
}

.lsre-brand-hero-inner {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lsre-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(31,58,138,0.12);
    border: 1px solid var(--lsre-border);
    font-size: 1.1rem;
}

.lsre-brand-title {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.lsre-brand-subtitle {
    margin: 0.35rem 0 0;
    color: var(--lsre-muted);
    font-size: 1rem;
}

.lsre-section-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.lsre-question {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--lsre-bg);
    border: 1px solid var(--lsre-border);
    border-radius: var(--lsre-radius);
    box-shadow: 0 1px 0 rgba(2,6,23,0.03);
}

/* Prevent flash of all questions in one-per-page mode */
.lsre-quiz-form[data-display-mode="one_per_page"] .lsre-question {
    display: none;
}

.lsre-question h3 {
    margin-top: 0;
    color: var(--lsre-primary);
    letter-spacing: -0.01em;
}

.lsre-question label {
    display: block;
    margin: 0.5rem 0;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.lsre-question label:hover {
    background: rgba(31,58,138,0.06);
    border-color: rgba(31,58,138,0.12);
}

.lsre-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--lsre-primary), #3b82f6);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: 0 10px 22px rgba(31,58,138,0.18);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.lsre-button:hover {
    filter: brightness(0.99);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(31,58,138,0.20);
}

.lsre-button:active {
    transform: translateY(0px);
    box-shadow: 0 10px 22px rgba(31,58,138,0.18);
}

.lsre-button:focus-visible {
    outline: 3px solid rgba(245,158,11,0.45);
    outline-offset: 2px;
}

.lsre-button[aria-disabled="true"],
.lsre-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lsre-button-premium {
    background: linear-gradient(135deg, var(--lsre-accent), #fbbf24);
    color: #111827;
}

.lsre-journey-card {
    margin: 1rem 0;
    padding: 1.5rem;
    border: 1px solid var(--lsre-border);
    border-radius: var(--lsre-radius);
    background: var(--lsre-bg);
    box-shadow: var(--lsre-shadow-soft);
}

.lsre-journey-card {
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.lsre-journey-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.10);
}

.lsre-journey-card h3, .lsre-journey-card h4 {
    letter-spacing: -0.01em;
}

.lsre-journey-card a.lsre-button {
    margin-top: 0.25rem;
}

/* Accordion */
.lsre-accordion-group {
    margin-top: 1.25rem;
}

.lsre-accordion {
    background: var(--lsre-bg);
    border: 1px solid var(--lsre-border);
    border-radius: var(--lsre-radius);
    box-shadow: var(--lsre-shadow-soft);
    margin-top: 0.9rem;
    overflow: hidden;
}

.lsre-accordion > summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.lsre-accordion > summary::-webkit-details-marker { display: none; }

.lsre-accordion-title {
    font-weight: 700;
    color: var(--lsre-text);
}

.lsre-accordion-subtitle {
    color: var(--lsre-muted);
    font-size: 0.95rem;
    text-align: right;
}

.lsre-accordion[open] > summary {
    background: rgba(15,118,110,0.06);
    border-bottom: 1px solid var(--lsre-border);
}

.lsre-accordion-body {
    padding: 1.1rem;
}

.lsre-prose p { margin: 0.65rem 0; }
.lsre-prose ul { margin: 0.65rem 0 0.65rem 1.1rem; }
.lsre-prose li { margin: 0.35rem 0; }

/* Progress bar polish */
.lsre-journey-progress, .lsre-progress {
    border-radius: var(--lsre-radius);
    border: 1px solid var(--lsre-border);
    background: rgba(255,255,255,0.9);
    box-shadow: 0 1px 0 rgba(2,6,23,0.03);
}

.lsre-journey-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.lsre-tag {
    padding: 0.25rem 0.75rem;
    background: #f0f0f0;
    border-radius: 16px;
    font-size: 0.875rem;
}

.lsre-book-card {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--lsre-border);
    border-radius: 8px;
    background: var(--lsre-bg);
    box-shadow: 0 1px 0 rgba(2,6,23,0.03);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.lsre-book-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.08);
}

/* Progress tracking (Premium) */
.lsre-journey-progress {
    margin: 12px 0 18px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
}

.lsre-journey-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.lsre-journey-progress-bar {
    height: 10px;
    background: #e9e9e9;
    border-radius: 10px;
    overflow: hidden;
}

.lsre-journey-progress-fill {
    height: 100%;
    width: 0;
}

.lsre-book-progress {
    margin-bottom: 8px;
    font-size: 13px;
}

.lsre-book-progress label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.lsre-book-card[data-journey-id] {
    position: relative;
}

/* History page */
.lsre-history {
    margin: 10px 0;
}

.lsre-history-list {
    display: grid;
    gap: 12px;
}

.lsre-history-item {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.lsre-history-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.lsre-compare {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #fafafa;
    font-size: 13px;
}

.lsre-book-cover img {
    max-width: 120px;
    height: auto;
    border-radius: 4px;
}

/* Book card enhancements: placeholder cover, details, buy links */
.lsre-book-cover {
    width: 120px;
    max-width: 120px;
}

.lsre-book-cover-placeholder {
    width: 120px;
    height: 160px;
    border-radius: 6px;
    border: 1px dashed #d8d8d8;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lsre-book-cover-placeholder-mark {
    font-size: 28px;
    opacity: 0.75;
}

.lsre-book-actions {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.lsre-book-details summary {
    cursor: pointer;
    font-weight: 600;
}

.lsre-book-details-body {
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
    font-size: 13px;
}

.lsre-book-buy-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lsre-buy-link {
    display: inline-block;
    padding: 8px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    background: #fff;
}

.lsre-buy-link:hover {
    filter: brightness(0.98);
}

.lsre-buy-link:focus-visible {
    outline: 3px solid rgba(245,158,11,0.45);
    outline-offset: 2px;
}

/* Details toggle polish */
.lsre-book-details > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lsre-book-details > summary::-webkit-details-marker { display: none; }

.lsre-book-details > summary::after {
    content: "▾";
    font-size: 0.9em;
    opacity: 0.75;
    transform: translateY(-1px);
}

.lsre-book-details[open] > summary::after {
    content: "▴";
}

/* Responsive layout */
@media (max-width: 640px) {
    .lsre-quiz-container, .lsre-results-container, .lsre-journey-detail {
        padding: 1rem;
    }

    .lsre-brand-hero-inner {
        align-items: flex-start;
    }

    .lsre-brand-title {
        font-size: 1.5rem;
    }

    .lsre-book-card {
        flex-direction: column;
        align-items: stretch;
    }

    .lsre-book-cover, .lsre-book-cover img, .lsre-book-cover-placeholder {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .lsre-book-cover-placeholder {
        height: 220px;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lsre-button,
    .lsre-journey-card,
    .lsre-book-card {
        transition: none;
    }
}

.lsre-upgrade-cta {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    margin: 2rem 0;
}

/* History (Premium) */
.lsre-history {
    margin: 18px 0;
}

.lsre-history-header p {
    margin-top: 6px;
    opacity: 0.85;
}

.lsre-history-compare {
    margin: 14px 0 18px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
}

.lsre-history-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.lsre-history-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.lsre-history-card {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.lsre-history-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.lsre-history-view {
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 640px) {
    .lsre-history-compare-grid {
        grid-template-columns: 1fr;
    }
}

.lsre-likert-scale {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.lsre-likert-scale label {
    flex: 1;
    text-align: center;
}

/* -----------------------------
   Premium quiz UI
------------------------------*/

.lsre-progress {
    margin: 1rem 0 1.5rem;
}

.lsre-progress-text {
    font-size: 0.95rem;
    color: var(--lsre-text);
}

.lsre-progress-bar {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--lsre-border);
}

.lsre-progress-fill {
    height: 100%;
    width: 0;
    background: var(--lsre-primary);
    transition: width 0.25s ease;
}

.lsre-quiz-nav {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.lsre-button-secondary {
    background: #666;
}

.lsre-button-secondary:hover {
    background: #555;
}

.lsre-question-header {
    margin-bottom: 1rem;
}

.lsre-question-help {
    margin: 0.5rem 0 0;
    color: #666;
    font-size: 0.95rem;
}

.lsre-question-error {
    margin-top: 0.75rem;
    color: #b00020;
    font-size: 0.95rem;
}

.lsre-hint {
    margin: 0.75rem 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* Ranking UI */
.lsre-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.lsre-ranking-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border: 1px solid var(--lsre-border);
    border-radius: 8px;
    background: #fafafa;
    cursor: move;
}

.lsre-ranking-item.is-dragging {
    opacity: 0.6;
}

.lsre-ranking-handle {
    font-size: 1.25rem;
    color: #888;
    line-height: 1;
}

@media (max-width: 600px) {
    .lsre-quiz-container, .lsre-results-container, .lsre-journey-detail {
        padding: 1rem;
    }
    .lsre-likert-scale {
        gap: 0.5rem;
    }
    .lsre-quiz-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .lsre-quiz-nav .lsre-button {
        width: 100%;
    }
}
