/**
 * Lady Hawk Proficiency Evaluator — Public styles
 * Premium, modern UI: indigo→violet gradient, refined typography,
 * 8-point spacing rhythm, layered shadows, subtle animations.
 *
 * All styles scoped under .lhpe-app to avoid theme conflicts.
 */

.lhpe-app {
    /* ── Brand palette ── */
    --lhpe-primary:        #4f46e5;          /* indigo-600 */
    --lhpe-primary-2:      #7c3aed;          /* violet-600 */
    --lhpe-primary-dark:   #3730a3;          /* indigo-800 */
    --lhpe-primary-soft:   rgba(79, 70, 229, 0.08);
    --lhpe-primary-light:  #eef2ff;          /* indigo-50 */
    --lhpe-gradient:       linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --lhpe-gradient-soft:  linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);

    /* ── Semantic colours ── */
    --lhpe-success:        #10b981;          /* emerald-500 */
    --lhpe-success-soft:   rgba(16, 185, 129, 0.10);
    --lhpe-warning:        #f59e0b;          /* amber-500 */
    --lhpe-warning-soft:   rgba(245, 158, 11, 0.12);
    --lhpe-danger:         #e11d48;          /* rose-600 */
    --lhpe-danger-soft:    rgba(225, 29, 72, 0.10);

    /* ── Neutrals ── */
    --lhpe-text:           #0f172a;          /* slate-900 */
    --lhpe-text-soft:      #334155;          /* slate-700 */
    --lhpe-muted:          #64748b;          /* slate-500 */
    --lhpe-faint:          #94a3b8;          /* slate-400 */
    --lhpe-border:         #e2e8f0;          /* slate-200 */
    --lhpe-border-soft:    #f1f5f9;          /* slate-100 */
    --lhpe-surface:        #ffffff;
    --lhpe-surface-2:      #f8fafc;          /* slate-50 */
    --lhpe-surface-3:      #f1f5f9;          /* slate-100 */
    --lhpe-bg:             #fafbff;          /* subtle indigo-tinted off-white */

    /* ── Shadows ── */
    --lhpe-shadow-xs:      0 1px 2px rgba(15, 23, 42, 0.04);
    --lhpe-shadow-sm:      0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --lhpe-shadow-md:      0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
    --lhpe-shadow-lg:      0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    --lhpe-shadow-xl:      0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 10px 20px -8px rgba(15, 23, 42, 0.06);
    --lhpe-shadow-glow:    0 8px 24px -8px rgba(79, 70, 229, 0.45);
    --lhpe-shadow-glow-success: 0 8px 24px -8px rgba(16, 185, 129, 0.45);

    /* ── Radius ── */
    --lhpe-radius-sm:      8px;
    --lhpe-radius:         12px;
    --lhpe-radius-lg:      16px;
    --lhpe-radius-xl:      20px;
    --lhpe-radius-full:    9999px;

    /* ── Typography ── */
    --lhpe-font:           -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --lhpe-font-mono:      ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

    /* ── Layout ── */
    font-family: var(--lhpe-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--lhpe-text);
    max-width: 920px;
    margin: 24px auto;
    padding: 0 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* ────────────────────────────────────────────────────────────────
   Stage card (the main container around each screen)
   ──────────────────────────────────────────────────────────────── */

.lhpe-stage {
    background: var(--lhpe-surface);
    border: 1px solid var(--lhpe-border);
    border-radius: var(--lhpe-radius-lg);
    box-shadow: var(--lhpe-shadow-lg);
    padding: 40px;
    animation: lhpe-fade-in 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.lhpe-stage-start {
    text-align: center;
}

@keyframes lhpe-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes lhpe-fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes lhpe-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

@keyframes lhpe-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ────────────────────────────────────────────────────────────────
   Icons
   ──────────────────────────────────────────────────────────────── */

.lhpe-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* ────────────────────────────────────────────────────────────────
   START SCREEN
   ──────────────────────────────────────────────────────────────── */

.lhpe-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--lhpe-primary-light);
    color: var(--lhpe-primary);
    border-radius: var(--lhpe-radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
    border: 1px solid rgba(79, 70, 229, 0.16);
}

.lhpe-brand-pill .lhpe-icon {
    width: 13px;
    height: 13px;
}

.lhpe-start-header {
    margin-bottom: 32px;
}

.lhpe-start-header h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--lhpe-text);
    margin: 0 0 12px;
    line-height: 1.2;
}

.lhpe-start-header p {
    font-size: 16px;
    color: var(--lhpe-muted);
    line-height: 1.6;
    max-width: 540px;
    margin: 0 auto;
}

/* Info pills row */

.lhpe-info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 0 32px;
}

.lhpe-info-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--lhpe-surface-2);
    border: 1px solid var(--lhpe-border);
    border-radius: var(--lhpe-radius);
    text-align: left;
    transition: all 0.2s ease;
}

.lhpe-info-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 70, 229, 0.20);
    background: var(--lhpe-surface);
    box-shadow: var(--lhpe-shadow-md);
}

.lhpe-info-pill-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--lhpe-primary-light);
    color: var(--lhpe-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lhpe-info-pill-icon .lhpe-icon {
    width: 18px;
    height: 18px;
}

.lhpe-info-pill-text {
    flex: 1;
    min-width: 0;
}

.lhpe-info-pill-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--lhpe-text);
    line-height: 1.3;
}

.lhpe-info-pill-sublabel {
    font-size: 12px;
    color: var(--lhpe-muted);
    margin-top: 2px;
}

/* Form */

.lhpe-form {
    text-align: left;
    max-width: 480px;
    margin: 0 auto 16px;
}

.lhpe-form-row {
    margin-bottom: 16px;
}

.lhpe-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--lhpe-text-soft);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.lhpe-form-row input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--lhpe-text);
    background: var(--lhpe-surface);
    border: 1.5px solid var(--lhpe-border);
    border-radius: var(--lhpe-radius-sm);
    transition: all 0.15s ease;
    line-height: 1.4;
}

.lhpe-form-row input:hover {
    border-color: var(--lhpe-faint);
}

.lhpe-form-row input:focus {
    outline: none;
    border-color: var(--lhpe-primary);
    box-shadow: 0 0 0 4px var(--lhpe-primary-soft);
}

.lhpe-form-row input::placeholder {
    color: var(--lhpe-faint);
}

/* Notice */

.lhpe-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--lhpe-primary-light);
    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: var(--lhpe-radius);
    color: var(--lhpe-primary-dark);
    font-size: 13px;
    line-height: 1.5;
    max-width: 540px;
    margin: 0 auto 20px;
    text-align: left;
}

.lhpe-notice .lhpe-icon {
    color: var(--lhpe-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.lhpe-error {
    background: var(--lhpe-danger-soft);
    color: var(--lhpe-danger);
    padding: 12px 16px;
    border-radius: var(--lhpe-radius-sm);
    font-size: 14px;
    margin: 0 auto 16px;
    max-width: 480px;
    text-align: left;
    border: 1px solid rgba(225, 29, 72, 0.18);
}

/* ────────────────────────────────────────────────────────────────
   Buttons
   ──────────────────────────────────────────────────────────────── */

/* Base button styles — apply across <button> AND <a> equally.
   Themes commonly override anchor color on :hover/:visited/:focus, so all
   states are explicitly re-set with !important to keep the contrast
   correct regardless of the active theme. */
.lhpe-app a.lhpe-btn,
.lhpe-app button.lhpe-btn,
.lhpe-app .lhpe-btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #ffffff !important;
    background: var(--lhpe-gradient);
    border: none;
    border-radius: var(--lhpe-radius-sm);
    cursor: pointer;
    text-decoration: none !important;
    text-shadow: none;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    box-shadow: var(--lhpe-shadow-glow), var(--lhpe-shadow-sm);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-appearance: none;
    appearance: none;
}

.lhpe-app a.lhpe-btn:hover,
.lhpe-app a.lhpe-btn:focus,
.lhpe-app a.lhpe-btn:visited,
.lhpe-app a.lhpe-btn:active,
.lhpe-app button.lhpe-btn:hover,
.lhpe-app button.lhpe-btn:focus,
.lhpe-app button.lhpe-btn:active,
.lhpe-app .lhpe-btn:hover,
.lhpe-app .lhpe-btn:focus,
.lhpe-app .lhpe-btn:active {
    color: #ffffff !important;
    text-decoration: none !important;
}

.lhpe-app .lhpe-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -8px rgba(79, 70, 229, 0.55), var(--lhpe-shadow-md);
}

.lhpe-app .lhpe-btn:active {
    transform: translateY(0);
    box-shadow: var(--lhpe-shadow-sm);
}

.lhpe-app .lhpe-btn:focus-visible {
    outline: 2px solid var(--lhpe-primary);
    outline-offset: 3px;
}

.lhpe-app .lhpe-btn:disabled,
.lhpe-app .lhpe-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lhpe-app .lhpe-btn-block {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 24px;
    font-size: 16px;
}

.lhpe-app .lhpe-btn-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lhpe-app .lhpe-btn-with-icon .lhpe-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

/* Success variant — emerald gradient, also full-white text in every state. */
.lhpe-app a.lhpe-btn-success,
.lhpe-app button.lhpe-btn-success,
.lhpe-app .lhpe-btn-success,
.lhpe-app a.lhpe-btn-success:hover,
.lhpe-app a.lhpe-btn-success:focus,
.lhpe-app a.lhpe-btn-success:visited,
.lhpe-app a.lhpe-btn-success:active,
.lhpe-app button.lhpe-btn-success:hover,
.lhpe-app button.lhpe-btn-success:focus,
.lhpe-app .lhpe-btn-success:hover,
.lhpe-app .lhpe-btn-success:focus {
    color: #ffffff !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    text-decoration: none !important;
}

.lhpe-app .lhpe-btn-success {
    box-shadow: var(--lhpe-shadow-glow-success), var(--lhpe-shadow-sm);
}

.lhpe-app .lhpe-btn-success:hover {
    box-shadow: 0 12px 28px -8px rgba(16, 185, 129, 0.55), var(--lhpe-shadow-md);
}

/* Ghost variant — transparent with slate text. Override theme link
   coloring in every state so it doesn't go blue on hover. */
.lhpe-app a.lhpe-btn-ghost,
.lhpe-app button.lhpe-btn-ghost,
.lhpe-app .lhpe-btn-ghost {
    background: transparent;
    color: var(--lhpe-text-soft) !important;
    border: 1.5px solid var(--lhpe-border);
    box-shadow: none;
    text-shadow: none;
}

.lhpe-app a.lhpe-btn-ghost:hover,
.lhpe-app a.lhpe-btn-ghost:focus,
.lhpe-app a.lhpe-btn-ghost:visited,
.lhpe-app a.lhpe-btn-ghost:active,
.lhpe-app button.lhpe-btn-ghost:hover,
.lhpe-app button.lhpe-btn-ghost:focus,
.lhpe-app .lhpe-btn-ghost:hover,
.lhpe-app .lhpe-btn-ghost:focus {
    background: var(--lhpe-surface-2);
    border-color: var(--lhpe-faint);
    color: var(--lhpe-text) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: var(--lhpe-shadow-sm);
}

/* ────────────────────────────────────────────────────────────────
   ASSESSMENT SCREEN
   ──────────────────────────────────────────────────────────────── */

.lhpe-assessment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--lhpe-border-soft);
}

.lhpe-progress {
    flex: 1;
    min-width: 0;
}

.lhpe-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--lhpe-muted);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}

.lhpe-progress-bar {
    height: 8px;
    background: var(--lhpe-surface-3);
    border-radius: var(--lhpe-radius-full);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.lhpe-progress-fill {
    height: 100%;
    background: var(--lhpe-gradient);
    border-radius: var(--lhpe-radius-full);
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.lhpe-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: lhpe-shimmer 2.5s linear infinite;
}

/* Timer */

.lhpe-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--lhpe-surface-2);
    border: 1px solid var(--lhpe-border);
    border-radius: var(--lhpe-radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--lhpe-text-soft);
    font-variant-numeric: tabular-nums;
    transition: all 0.2s ease;
}

.lhpe-timer .lhpe-icon {
    width: 16px;
    height: 16px;
    color: var(--lhpe-muted);
}

.lhpe-timer-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--lhpe-muted);
    letter-spacing: 0.02em;
}

.lhpe-timer-value {
    font-family: var(--lhpe-font-mono);
    font-size: 15px;
    color: var(--lhpe-text);
}

.lhpe-timer.lhpe-timer-warning {
    background: var(--lhpe-warning-soft);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--lhpe-warning);
}

.lhpe-timer.lhpe-timer-warning .lhpe-icon,
.lhpe-timer.lhpe-timer-warning .lhpe-timer-label,
.lhpe-timer.lhpe-timer-warning .lhpe-timer-value {
    color: #b45309;
}

.lhpe-timer.lhpe-timer-danger {
    background: var(--lhpe-danger-soft);
    border-color: rgba(225, 29, 72, 0.3);
    color: var(--lhpe-danger);
    animation: lhpe-pulse 1.5s ease-in-out infinite;
}

.lhpe-timer.lhpe-timer-danger .lhpe-icon,
.lhpe-timer.lhpe-timer-danger .lhpe-timer-label,
.lhpe-timer.lhpe-timer-danger .lhpe-timer-value {
    color: var(--lhpe-danger);
}

/* Reading passage */

.lhpe-passage {
    background: linear-gradient(180deg, #fefce8 0%, #fffbeb 100%);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-left: 3px solid var(--lhpe-warning);
    border-radius: var(--lhpe-radius);
    padding: 20px 22px;
    margin-bottom: 24px;
}

.lhpe-passage-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b45309;
    margin-bottom: 8px;
}

.lhpe-passage-label .lhpe-icon {
    width: 13px;
    height: 13px;
}

.lhpe-passage-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: #78350f;
    letter-spacing: -0.01em;
}

.lhpe-passage-content {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #44403c;
}

/* Question meta tags */

.lhpe-question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.lhpe-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--lhpe-surface-3);
    color: var(--lhpe-text-soft);
    border-radius: var(--lhpe-radius-full);
    border: 1px solid var(--lhpe-border);
}

/* Question text */

.lhpe-question-text {
    font-size: 19px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--lhpe-text);
    margin: 0 0 24px;
    letter-spacing: -0.01em;
}

/* Options */

.lhpe-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.lhpe-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--lhpe-surface);
    border: 1.5px solid var(--lhpe-border);
    border-radius: var(--lhpe-radius);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.lhpe-option:hover {
    border-color: rgba(79, 70, 229, 0.25);
    background: var(--lhpe-primary-soft);
    transform: translateX(2px);
}

.lhpe-option input[type="radio"] {
    /* Hide the native radio — we'll style the letter chip instead. */
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lhpe-option-letter {
    width: 32px;
    height: 32px;
    border-radius: var(--lhpe-radius-sm);
    background: var(--lhpe-surface-3);
    color: var(--lhpe-text-soft);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1.5px solid transparent;
    transition: all 0.15s ease;
}

.lhpe-option-text {
    flex: 1;
    font-size: 15px;
    color: var(--lhpe-text);
    line-height: 1.5;
}

.lhpe-option-selected {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(124, 58, 237, 0.06) 100%);
    border-color: var(--lhpe-primary);
    box-shadow: 0 0 0 4px var(--lhpe-primary-soft);
}

.lhpe-option-selected .lhpe-option-letter {
    background: var(--lhpe-gradient);
    color: #ffffff;
    border-color: var(--lhpe-primary);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.lhpe-option-selected .lhpe-option-text {
    font-weight: 500;
}

/* Navigation */

.lhpe-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.lhpe-nav-right {
    display: flex;
    gap: 10px;
}

/* Answer hint — shown when learner tries to advance without choosing an option */

.lhpe-answer-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -8px 0 20px;
    padding: 10px 14px;
    background: var(--lhpe-warning-soft);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: var(--lhpe-radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s ease, max-height 0.2s ease, margin 0.2s ease, padding 0.2s ease;
    overflow: hidden;
    max-height: 56px;
}

.lhpe-answer-hint .lhpe-icon {
    color: var(--lhpe-warning);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.lhpe-answer-hint-hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: -8px;
    margin-bottom: 0;
    border-width: 0;
}

@keyframes lhpe-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.lhpe-answer-hint-shake {
    animation: lhpe-shake 0.45s ease-in-out;
}

/* ────────────────────────────────────────────────────────────────
   RESULTS SCREEN
   ──────────────────────────────────────────────────────────────── */

.lhpe-result-hero {
    position: relative;
    background: var(--lhpe-gradient);
    color: #ffffff;
    border-radius: var(--lhpe-radius-lg);
    padding: 36px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: 0 20px 50px -12px rgba(79, 70, 229, 0.45);
    animation: lhpe-fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lhpe-result-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.lhpe-result-hero::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.lhpe-hero-block {
    position: relative;
    z-index: 1;
}

.lhpe-hero-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 10px;
}

.lhpe-hero-value {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.lhpe-hero-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

.lhpe-cefr-desc {
    grid-column: 1 / -1;
    margin-top: 14px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    position: relative;
    z-index: 1;
}

/* Greeting */

.lhpe-greeting {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--lhpe-surface-2);
    border: 1px solid var(--lhpe-border);
    border-radius: var(--lhpe-radius);
    font-size: 14px;
    color: var(--lhpe-text-soft);
    margin: 0 0 28px;
}

.lhpe-greeting .lhpe-icon {
    color: var(--lhpe-primary);
}

/* Sections */

.lhpe-section {
    margin-bottom: 32px;
}

.lhpe-section-title,
.lhpe-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--lhpe-text);
    letter-spacing: -0.01em;
}

.lhpe-section-title .lhpe-icon {
    color: var(--lhpe-primary);
}

/* Category breakdown */

.lhpe-cat-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--lhpe-border-soft);
    align-items: center;
}

.lhpe-cat-row:last-child {
    border-bottom: none;
}

.lhpe-cat-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--lhpe-text);
    grid-column: 1;
    grid-row: 1;
}

.lhpe-cat-fraction {
    font-size: 13px;
    color: var(--lhpe-muted);
    font-variant-numeric: tabular-nums;
    grid-column: 2;
    grid-row: 1;
}

.lhpe-cat-pct {
    font-size: 15px;
    font-weight: 700;
    color: var(--lhpe-text);
    font-variant-numeric: tabular-nums;
    grid-column: 3;
    grid-row: 1;
    text-align: right;
    min-width: 50px;
}

.lhpe-cat-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 6px;
    background: var(--lhpe-surface-3);
    border-radius: var(--lhpe-radius-full);
    overflow: hidden;
}

.lhpe-cat-bar-fill {
    height: 100%;
    border-radius: var(--lhpe-radius-full);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    animation: lhpe-bar-grow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes lhpe-bar-grow {
    from { width: 0 !important; }
}

.lhpe-cat-bar-fill.weak {
    background: linear-gradient(90deg, #e11d48 0%, #f43f5e 100%);
}

.lhpe-cat-bar-fill.moderate {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.lhpe-cat-bar-fill.strong {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

/* Feedback */

.lhpe-feedback p {
    position: relative;
    padding: 14px 16px 14px 22px;
    margin: 0 0 10px;
    background: var(--lhpe-surface-2);
    border-radius: var(--lhpe-radius);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--lhpe-text-soft);
}

.lhpe-feedback p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: var(--lhpe-radius-full);
    background: var(--lhpe-gradient);
}

/* Recommendations */

.lhpe-recs ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lhpe-recs li {
    position: relative;
    padding: 14px 16px 14px 44px;
    background: var(--lhpe-surface-2);
    border: 1px solid var(--lhpe-border-soft);
    border-radius: var(--lhpe-radius);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--lhpe-text-soft);
    transition: all 0.15s ease;
}

.lhpe-recs li:hover {
    background: var(--lhpe-surface);
    border-color: var(--lhpe-border);
    transform: translateX(2px);
    box-shadow: var(--lhpe-shadow-sm);
}

.lhpe-recs li::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 16px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lhpe-success-soft);
    border: 1.5px solid var(--lhpe-success);
}

.lhpe-recs li::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 21px;
    width: 8px;
    height: 4px;
    border-left: 2px solid var(--lhpe-success);
    border-bottom: 2px solid var(--lhpe-success);
    transform: rotate(-45deg);
}

/* Result actions */

.lhpe-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--lhpe-border-soft);
}

/* ────────────────────────────────────────────────────────────────
   LOADING & ERROR STATES
   ──────────────────────────────────────────────────────────────── */

.lhpe-loading {
    text-align: center;
    padding: 60px 24px;
    color: var(--lhpe-muted);
    font-size: 14px;
}

.lhpe-loading::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--lhpe-surface-3);
    border-top-color: var(--lhpe-primary);
    border-radius: 50%;
    animation: lhpe-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes lhpe-spin {
    to { transform: rotate(360deg); }
}

/* ────────────────────────────────────────────────────────────────
   RESPONSIVE — mobile-first refinements
   ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .lhpe-app {
        padding: 0 12px;
        margin: 12px auto;
        font-size: 15px;
    }
    .lhpe-stage {
        padding: 22px 18px;
        border-radius: var(--lhpe-radius);
    }
    .lhpe-start-header h2 {
        font-size: 24px;
    }
    .lhpe-start-header p {
        font-size: 14px;
    }
    .lhpe-info-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .lhpe-assessment-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding-bottom: 18px;
    }
    .lhpe-timer {
        justify-content: flex-start;
    }
    .lhpe-question-text {
        font-size: 17px;
    }
    .lhpe-option {
        padding: 12px 14px;
        gap: 10px;
    }
    .lhpe-option-letter {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .lhpe-option-text {
        font-size: 14px;
    }
    .lhpe-nav {
        flex-wrap: wrap;
    }
    .lhpe-nav .lhpe-btn,
    .lhpe-nav-right .lhpe-btn {
        flex: 1;
        min-width: 0;
    }
    .lhpe-result-hero {
        grid-template-columns: 1fr;
        padding: 26px 22px;
        gap: 16px;
    }
    .lhpe-hero-value {
        font-size: 44px;
    }
    .lhpe-cat-row {
        grid-template-columns: 1fr auto;
    }
    .lhpe-cat-fraction {
        grid-column: 1;
        grid-row: 2;
    }
    .lhpe-cat-pct {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }
    .lhpe-cat-bar {
        grid-column: 1 / -1;
        grid-row: 3;
    }
    .lhpe-result-actions .lhpe-btn {
        flex: 1;
        min-width: calc(50% - 5px);
    }
    .lhpe-passage {
        padding: 16px;
    }
    .lhpe-passage-content {
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .lhpe-stage {
        padding: 18px 14px;
    }
    .lhpe-result-actions .lhpe-btn {
        flex-basis: 100%;
    }
}

/* ────────────────────────────────────────────────────────────────
   ACCESSIBILITY — Reduced motion
   ──────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .lhpe-app *,
    .lhpe-app *::before,
    .lhpe-app *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .lhpe-progress-fill::after {
        display: none;
    }
}

/* ────────────────────────────────────────────────────────────────
   FULLSCREEN MODE — takes over the viewport with corner close button
   ──────────────────────────────────────────────────────────────── */

/* Lock scrolling on the underlying page while fullscreen is active. */
html.lhpe-fullscreen-html,
body.lhpe-fullscreen-active {
    overflow: hidden !important;
    height: 100%;
}

/* The container itself becomes a pinned viewport overlay. */
.lhpe-app-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2147483646;        /* sit above just about everything */
    margin: 0;
    padding: 0;
    max-width: none;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.06) 0%, transparent 40%),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.05) 0%, transparent 40%),
        var(--lhpe-bg);
    animation: lhpe-fade-in 0.3s ease;
}

/* Centre the stage inside the viewport with breathing room. */
.lhpe-app-fullscreen > .lhpe-stage,
.lhpe-app-fullscreen > .lhpe-loading-stage {
    max-width: 920px;
    margin: 56px auto 48px;
    /* slight horizontal padding so the stage edges don't kiss narrow viewports */
}

/* Close (×) button — floating, top-right corner of the viewport. */
.lhpe-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2147483647;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--lhpe-border);
    border-radius: var(--lhpe-radius-full);
    background: var(--lhpe-surface);
    color: var(--lhpe-text-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--lhpe-shadow-md);
    transition: all 0.18s ease;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.lhpe-close-btn:hover {
    color: var(--lhpe-danger);
    border-color: rgba(225, 29, 72, 0.35);
    background: #fff;
    box-shadow: 0 8px 24px -6px rgba(225, 29, 72, 0.3), var(--lhpe-shadow-sm);
    transform: scale(1.06) rotate(90deg);
}

.lhpe-close-btn:active {
    transform: scale(0.96) rotate(90deg);
}

.lhpe-close-btn:focus-visible {
    outline: 2px solid var(--lhpe-primary);
    outline-offset: 3px;
}

.lhpe-close-btn .lhpe-icon {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Fullscreen-specific responsive tweaks. */
@media (max-width: 640px) {
    .lhpe-app-fullscreen > .lhpe-stage,
    .lhpe-app-fullscreen > .lhpe-loading-stage {
        margin: 64px 12px 24px;
    }
    .lhpe-close-btn {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
    .lhpe-close-btn .lhpe-icon {
        width: 18px;
        height: 18px;
    }
}
