/**
 * CGR Quiz - Styles CSS
 * Basé sur la maquette « Mon check-up Commerçant Responsable® »,
 * scoped sous .cgr-quiz pour ne rien impacter en dehors du widget.
 */

.cgr-quiz {
    --cgr-quiz-teal: #087c83;
    --cgr-quiz-teal-dark: #07545d;
    --cgr-quiz-navy: #123b4a;
    --cgr-quiz-lime: #c9dd20;
    --cgr-quiz-cream: #f6f3e8;
    --cgr-quiz-white: #fff;
    --cgr-quiz-muted: #65777d;
    --cgr-quiz-line: #dbe5e4;
    --cgr-quiz-shadow: 0 18px 50px rgba(11, 62, 70, .13);

    box-sizing: border-box;
    max-width: 940px;
    margin: 0 auto;
    font-family: Arial, "Helvetica Neue", sans-serif;
    color: var(--cgr-quiz-navy);
}

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

/* Bandeau d'introduction */
.cgr-quiz-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 30px;
    padding: 42px 24px;
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 18%, rgba(38, 183, 203, .34), transparent 32%),
        radial-gradient(circle at 92% 12%, rgba(9, 30, 43, .9), transparent 38%),
        linear-gradient(135deg, #158ea2 0%, #086477 46%, #062d3c 100%);
}

.cgr-quiz-eyebrow {
    color: #dce51f;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 13px;
}

.cgr-quiz-hero-title {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.05;
    letter-spacing: -.02em;
    margin: 12px 0 16px;
}

.cgr-quiz-hero-intro {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .9);
    margin: 0 0 16px;
}

.cgr-quiz-reassure {
    display: flex;
    justify-content: center;
    gap: 12px 25px;
    flex-wrap: wrap;
    font-weight: 700;
    font-size: 14px;
}

.cgr-quiz-reassure span::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--cgr-quiz-lime);
    color: var(--cgr-quiz-navy);
}

/* Carte principale */
.cgr-quiz-card {
    background: #fff;
    border: 1px solid rgba(8, 124, 131, .12);
    border-radius: 8px;
    box-shadow: var(--cgr-quiz-shadow);
    overflow: hidden;
}

.cgr-quiz-progress-wrap {
    padding: 24px 28px 12px;
}

.cgr-quiz-progress-info {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 13px;
    font-weight: 800;
    color: var(--cgr-quiz-teal);
    margin-bottom: 10px;
}

.cgr-quiz-progress-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cgr-quiz-btn-link {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    color: var(--cgr-quiz-teal);
    text-decoration: underline;
    cursor: pointer;
}

.cgr-quiz-progress {
    height: 9px;
    border-radius: 10px;
    background: #e5eeee;
    overflow: hidden;
}

.cgr-quiz-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cgr-quiz-teal), var(--cgr-quiz-lime));
    transition: width .35s ease;
}

/* Écrans */
.cgr-quiz-screen {
    display: none;
    padding: 28px 52px 46px;
}

.cgr-quiz-screen.active {
    display: block;
}

.cgr-quiz-screen h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(27px, 4vw, 39px);
    margin: 0 0 12px;
    line-height: 1.2;
}

.cgr-quiz-lead-text {
    color: var(--cgr-quiz-muted);
    line-height: 1.55;
    margin: 0 0 28px;
}

/* Écran de démarrage */
.cgr-quiz-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cgr-quiz-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.cgr-quiz-field-full {
    grid-column: 1 / -1;
}

.cgr-quiz-field label {
    font-size: 14px;
    font-weight: 800;
}

.cgr-quiz-field input {
    width: 100%;
    padding: 15px;
    border: 1.5px solid var(--cgr-quiz-line);
    border-radius: 12px;
    font: inherit;
    color: var(--cgr-quiz-navy);
    outline: none;
}

.cgr-quiz-field input:focus {
    border-color: var(--cgr-quiz-teal);
    box-shadow: 0 0 0 3px rgba(8, 124, 131, .1);
}

.cgr-quiz-lead-error {
    color: #b3261e;
    font-weight: 700;
    font-size: 14px;
    margin: 16px 0 0;
}

/* Écran des questions */
.cgr-quiz-theme {
    display: inline-block;
    color: #087b90;
    background: #e4f4f5;
    border-radius: 100px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
}

.cgr-quiz-question-text {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(23px, 3.5vw, 34px);
    line-height: 1.25;
    margin: 0 0 26px;
}

.cgr-quiz-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.cgr-quiz-answer {
    appearance: none;
    border: 1.5px solid var(--cgr-quiz-line);
    background: #fff;
    border-radius: 14px;
    padding: 17px 19px;
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    color: var(--cgr-quiz-navy);
    cursor: pointer;
    transition: .2s;
}

.cgr-quiz-answer:hover,
.cgr-quiz-answer:focus {
    border-color: #0b8297;
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(11, 130, 151, .13);
}

.cgr-quiz-answer.selected {
    background: #096f83;
    color: #fff;
    border-color: #096f83;
}

/* Actions communes */
.cgr-quiz-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
}

.cgr-quiz-btn {
    border: 0;
    border-radius: 100px;
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cgr-quiz-btn-primary {
    background: #dce51f;
    color: #073d4d;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.cgr-quiz-btn-primary:hover {
    filter: brightness(.96);
}

.cgr-quiz-btn-secondary {
    background: transparent;
    color: #087b90;
    padding-left: 0;
}

.cgr-quiz-btn[disabled] {
    opacity: .4;
    cursor: not-allowed;
}

/* Écran de résultat */
.cgr-quiz-result {
    text-align: center;
}

.cgr-quiz-score-ring {
    width: 152px;
    height: 152px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 12px auto 24px;
    background: conic-gradient(#dce51f var(--score), #e3eceb 0);
    position: relative;
}

.cgr-quiz-score-ring::after {
    content: "";
    position: absolute;
    inset: 12px;
    background: #fff;
    border-radius: 50%;
}

.cgr-quiz-score-text {
    position: relative;
    z-index: 1;
}

.cgr-quiz-score-text strong {
    font-size: 42px;
    display: block;
}

.cgr-quiz-score-text span {
    font-size: 12px;
    font-weight: 800;
    color: var(--cgr-quiz-muted);
}

.cgr-quiz-result-eyebrow {
    color: #dce51f;
    background: none;
}

.cgr-quiz-result-box {
    background: #edf7f6;
    border-radius: 16px;
    padding: 22px;
    text-align: left;
    margin: 24px 0;
}

.cgr-quiz-result-box h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    margin: 0 0 8px;
}

.cgr-quiz-result-box p {
    margin: 0;
    line-height: 1.55;
    color: #476068;
}

.cgr-quiz-submit-status {
    font-weight: 700;
    min-height: 1.5em;
    margin: 12px 0 0;
}

.cgr-quiz-submit-status.success {
    color: #0b7a3d;
}

.cgr-quiz-submit-status.error {
    color: #b3261e;
}

.cgr-quiz-privacy {
    font-size: 12px;
    color: #728388;
    text-align: center;
    margin-top: 18px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 650px) {
    .cgr-quiz-screen {
        padding: 24px 22px 34px;
    }

    .cgr-quiz-progress-wrap {
        padding: 22px 22px 8px;
    }

    .cgr-quiz-fields,
    .cgr-quiz-answers {
        grid-template-columns: 1fr;
    }

    .cgr-quiz-field-full {
        grid-column: auto;
    }

    .cgr-quiz-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .cgr-quiz-btn {
        width: 100%;
    }

    .cgr-quiz-intro {
        margin-bottom: 22px;
    }
}
