/**
 * EF Quiz lightweight participant Runtime.
 * Version: 1.0.0-dev1
 */

.efq-runtime-page *,
.efq-live-preview * { box-sizing: border-box; }

.efq-runtime-page {
    position: relative;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    isolation: isolate;
    background: var(--efq-background, #f5f7fa);
    color: #182230;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}

.efq-runtime-embed {
    display: grid;
    min-height: 34rem;
    place-items: center;
    overflow: hidden;
    padding: clamp(1rem, 3vw, 2.5rem);
    border-radius: 1rem;
}
.efq-runtime-embed .efq-visual__background,
.efq-runtime-embed .efq-visual__overlay { position: absolute; }
.efq-runtime-embed > .efq-runtime-card { position: relative; z-index: 1; width: min(100%, 50rem); }

.efq-visual__background,
.efq-visual__overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.efq-visual__background {
    z-index: -2;
    object-fit: cover;
    object-position: var(--efq-background-position, center center);
}

@media (max-width: 1024px) {
    .efq-visual__background { object-position: var(--efq-background-position-tablet, var(--efq-background-position, center center)); }
}

@media (max-width: 600px) {
    .efq-visual__background { object-position: var(--efq-background-position-mobile, var(--efq-background-position-tablet, var(--efq-background-position, center center))); }
}

.efq-visual__overlay {
    z-index: -1;
    background: var(--efq-overlay, #000);
    opacity: var(--efq-overlay-opacity, 0);
}

.efq-background-gradient.efq-gradient-sunset { background-image: linear-gradient(135deg, #5f1624, #ce5b2b 55%, #f2c078); }
.efq-background-gradient.efq-gradient-ocean { background-image: linear-gradient(135deg, #0c365f, #176b87 55%, #9bc9c4); }
.efq-background-gradient.efq-gradient-ember { background-image: linear-gradient(135deg, #2d1720, #8c2f21 60%, #de8f44); }
.efq-background-gradient.efq-gradient-slate { background-image: linear-gradient(135deg, #172033, #48566d 60%, #a7b0bd); }
.efq-background-gradient.efq-gradient-ivory { background-image: linear-gradient(135deg, #e8dfcd, #fffdf6 55%, #c8b892); }

.efq-runtime-skip {
    position: fixed;
    z-index: 10;
    top: .5rem;
    left: .5rem;
    padding: .65rem 1rem;
    transform: translateY(-180%);
    background: #182230;
    color: #fff;
}

.efq-runtime-skip:focus { transform: translateY(0); }

.efq-runtime-shell {
    position: relative;
    z-index: 1;
    width: min(100% - 2rem, 50rem);
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.efq-runtime-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border: 1px solid #c7cdd5;
    border-radius: .65rem;
    background: #eef3fb;
}

.efq-runtime-preview a { color: #174ea6; font-weight: 650; }

.efq-runtime-card {
    padding: clamp(1.25rem, 4vw, 3rem);
    border: 1px solid #c7cdd5;
    border-radius: 1rem;
    background: rgb(255 255 255 / var(--efq-card-opacity, 1));
    backdrop-filter: blur(var(--efq-card-blur, 0));
    box-shadow: 0 .5rem 1.5rem rgb(16 24 40 / 8%);
}

.efq-card-invisible .efq-runtime-card { border-color: transparent; box-shadow: none; }

.efq-card-glass .efq-runtime-card {
    border-color: rgb(255 255 255 / 55%);
    background: rgb(255 255 255 / var(--efq-card-opacity, .45));
    backdrop-filter: blur(var(--efq-card-blur, 14px));
}

.efq-card-cinema .efq-runtime-card {
    border-color: #3b3b3b;
    border-radius: .2rem;
    background: rgb(21 21 21 / var(--efq-card-opacity, 1));
    color: #fff;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 30%);
}
.efq-card-cinema .efq-runtime-eyebrow,
.efq-card-cinema .efq-runtime-progress { color: #d8dce4; }
.efq-card-cinema .efq-runtime-option { border-color: #747b86; }
.efq-card-cinema .efq-runtime-option:has(input:checked) { color: #182230; }

.efq-card-minimal .efq-runtime-card { border: 0; border-radius: 0; box-shadow: none; }
.efq-card-panel .efq-runtime-card { border-left: .55rem solid var(--efq-accent, #174ea6); }
.efq-card-split .efq-runtime-card { border-radius: 0 1rem 1rem 0; box-shadow: -.55rem 0 0 var(--efq-accent, #174ea6), 0 .5rem 1.5rem rgb(16 24 40 / 8%); }
.efq-theme-flamenco .efq-runtime-card { font-family: Georgia, "Times New Roman", serif; }
.efq-theme-midnight .efq-runtime-card { box-shadow: 0 1.25rem 3.5rem rgb(0 0 0 / 32%); }
.efq-theme-gallery .efq-runtime-card { border-width: .25rem; }
.efq-type-small { font-size: .925rem; }
.efq-type-large { font-size: 1.125rem; }

.efq-runtime-card h1,
.efq-runtime-card h2,
.efq-runtime-card legend { line-height: 1.25; }

.efq-runtime-card h1,
.efq-runtime-card legend {
    margin: 0 0 1.25rem;
    font-size: clamp(1.65rem, 5vw, 2.5rem);
    font-weight: 750;
}

.efq-runtime-eyebrow,
.efq-runtime-progress {
    margin: 0 0 .75rem;
    color: #475467;
    font-weight: 700;
}

.efq-runtime-description { font-size: 1.1rem; }

.efq-runtime-question fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.efq-runtime-options { display: grid; gap: .75rem; margin: 1.5rem 0; }

.efq-runtime-option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .8rem;
    align-items: start;
    padding: 1rem;
    border: 2px solid #c7cdd5;
    border-radius: .75rem;
    cursor: pointer;
}

.efq-runtime-option:hover { border-color: var(--efq-accent, #174ea6); }
.efq-runtime-option:has(input:checked) { border-color: var(--efq-accent, #174ea6); background: #eef4ff; }
.efq-runtime-option input { width: 1.25rem; height: 1.25rem; margin: .12rem 0 0; }
.efq-runtime-question--appearance-preview .efq-runtime-option { cursor: default; }
.efq-runtime-preview-note { margin: 1rem 0 0; color: #475467; font-size: .92rem; }

.efq-runtime-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    padding: .65rem 1.15rem;
    border: 2px solid var(--efq-button, #174ea6);
    border-radius: .55rem;
    background: #fff;
    color: var(--efq-button, #174ea6);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.efq-runtime-button {
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.efq-runtime-button:hover { background: #f7f3ed; }
.efq-runtime-button--primary {
    background: var(--efq-button, #da2b1f);
    border-color: var(--efq-button, #da2b1f);
    color: #fff;
}
.efq-runtime-button--primary:hover,
.efq-runtime-button--primary:focus-visible {
    background: #bd241a;
    border-color: #bd241a;
    color: #fff;
    filter: none;
}
.efq-runtime-button--primary:active {
    background: #a91f17;
    border-color: #a91f17;
    color: #fff;
    transform: translateY(1px);
}

.efq-runtime-option:focus-within,
.efq-runtime-button:focus-visible,
.efq-runtime-preview a:focus-visible,
.efq-runtime-skip:focus-visible,
.efq-runtime-share__button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--efq-focus, #101828);
}

[data-efq-runtime-focus]:focus,
[data-efq-runtime-focus]:focus-visible {
    outline: none;
    box-shadow: none;
}

.efq-runtime-error {
    padding: .8rem 1rem;
    border-left: .3rem solid #a32121;
    background: #fff0f0;
    color: #711515;
    font-weight: 650;
}

.efq-runtime-feedback h1.is-correct { color: var(--efq-correct, #176b3a); }
.efq-runtime-feedback h1.is-incorrect { color: var(--efq-incorrect, #a32121); }

.efq-runtime-feedback-options {
    display: grid;
    gap: .65rem;
    margin: 1.25rem 0;
    padding: 0;
    list-style: none;
}

.efq-runtime-feedback-options li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .85rem 1rem;
    border: 2px solid #c7cdd5;
    border-radius: .65rem;
}

.efq-runtime-feedback-options li.is-selected { border-style: dashed; border-color: #174ea6; }
.efq-runtime-feedback-options li.is-correct { border-style: solid; border-color: var(--efq-correct, #176b3a); background: #e9f7ef; }
.efq-runtime-feedback-options strong { color: #182230; font-size: .9rem; }

.efq-runtime-explanation {
    margin: 1.25rem 0;
    padding: 1rem;
    border-left: .3rem solid #174ea6;
    background: #f4f7fb;
}

.efq-runtime-explanation h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.efq-runtime-explanation p { margin: 0; }

.efq-runtime-result__intro { margin: -.5rem 0 1.25rem; font-size: 1.1rem; }
.efq-runtime-result p,
.efq-runtime-review dd { overflow-wrap: anywhere; }
.efq-runtime-result__summary {
    margin: 0 0 1.25rem;
    padding: .85rem 1rem;
    border-left: .3rem solid var(--efq-accent, #174ea6);
    background: rgb(238 244 255 / 88%);
    font-weight: 650;
}
.efq-runtime-result__metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}
.efq-runtime-score { display: grid; margin: 0; font-size: 1.05rem; }
.efq-runtime-score strong { font-size: 2rem; }
.efq-runtime-percentage { margin: 0; font-size: clamp(2.4rem, 10vw, 4.5rem); font-weight: 800; line-height: 1; }
.efq-runtime-result__band {
    margin: 0 0 1.5rem;
    padding: 1rem;
    border: 2px solid var(--efq-accent, #174ea6);
    border-radius: .75rem;
}
.efq-runtime-review { margin: 2rem 0; border-top: 1px solid #c7cdd5; padding-top: 1.5rem; }
.efq-runtime-review > h2 { margin: 0 0 1rem; }
.efq-runtime-review > ol { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.efq-runtime-review__item { padding: 1rem; border: 1px solid #c7cdd5; border-radius: .75rem; }
.efq-runtime-review__item h3 { margin: 0 0 .35rem; font-size: 1rem; }
.efq-runtime-review__item p { margin: .35rem 0; }
.efq-runtime-review__status { font-size: .95rem; }
.efq-runtime-review__item dl { display: grid; gap: .6rem; margin: .8rem 0 0; }
.efq-runtime-review__item dl div { display: grid; grid-template-columns: minmax(7rem, .35fr) 1fr; gap: .75rem; }
.efq-runtime-review__item dt { font-weight: 700; }
.efq-runtime-review__item dd { margin: 0; }
.efq-runtime-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.efq-runtime-actions form { margin: 0; }

.efq-motion-subtle .efq-runtime-card { animation: efq-enter-subtle .28s ease-out both; }
.efq-motion-subtle .efq-runtime-feedback h1 { animation: efq-feedback-subtle .32s ease-out both; }
.efq-motion-dynamic .efq-runtime-card { animation: efq-enter-dynamic .42s cubic-bezier(.2, .8, .2, 1) both; }
.efq-motion-dynamic .efq-runtime-feedback h1 { animation: efq-feedback-dynamic .48s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes efq-enter-subtle { from { opacity: 0; transform: translateY(.35rem); } to { opacity: 1; transform: none; } }
@keyframes efq-feedback-subtle { from { opacity: 0; } to { opacity: 1; } }
@keyframes efq-enter-dynamic { from { opacity: 0; transform: translateY(1rem) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes efq-feedback-dynamic { 0% { opacity: 0; transform: scale(.92); } 70% { transform: scale(1.035); } 100% { opacity: 1; transform: none; } }

@media (max-width: 36rem) {
    .efq-runtime-shell { width: min(100% - 1rem, 50rem); padding-top: .5rem; }
    .efq-runtime-preview { align-items: flex-start; flex-direction: column; }
    .efq-runtime-card { border-radius: .75rem; }
    .efq-runtime-result__metrics { grid-template-columns: 1fr; align-items: start; }
    .efq-runtime-review__item dl div { grid-template-columns: 1fr; gap: .1rem; }
    .efq-runtime-actions, .efq-runtime-actions form, .efq-runtime-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


.efq-runtime-share {
    position: fixed;
    z-index: 20;
    right: max(1.25rem, env(safe-area-inset-right));
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    display: grid;
    justify-items: end;
    gap: .45rem;
    pointer-events: none;
}

.efq-runtime-share__button {
    display: inline-flex;
    gap: .55rem;
    align-items: center;
    min-width: 2.9rem;
    min-height: 2.9rem;
    padding: .7rem 1rem;
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 999px;
    background: #111;
    color: #fff;
    box-shadow: 0 .75rem 2rem rgb(0 0 0 / 22%);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.efq-runtime-share__button:hover {
    background: #bd241a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 1rem 2.25rem rgb(0 0 0 / 28%);
}

.efq-runtime-share__button:disabled { opacity: .65; cursor: wait; }
.efq-runtime-share__button svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.efq-runtime-share__status {
    min-height: 1.1rem;
    margin: 0;
    padding: .3rem .6rem;
    border-radius: 999px;
    background: rgb(17 17 17 / 88%);
    color: #fff;
    font-size: .78rem;
    line-height: 1.25;
    pointer-events: none;
}
.efq-runtime-share__status:empty { display: none; }

[data-efq-view="question"] .efq-runtime-share__button,
[data-efq-view="feedback"] .efq-runtime-share__button {
    width: 2.9rem;
    padding-inline: .85rem;
}
[data-efq-view="question"] .efq-runtime-share__button span,
[data-efq-view="feedback"] .efq-runtime-share__button span { display: none; }

@media (max-width: 36rem) {
    .efq-runtime-share { right: max(.75rem, env(safe-area-inset-right)); bottom: max(.75rem, env(safe-area-inset-bottom)); }
    .efq-runtime-share__button { width: 2.9rem; padding-inline: .85rem; }
    .efq-runtime-share__button span { display: none; }
}

.efq-runtime-share--left { right: auto; left: max(20px, env(safe-area-inset-left)); }
@media (max-width: 782px) { .efq-runtime-share--left { left: max(.75rem, env(safe-area-inset-left)); } }
