/*
 * Feuille de styles mobile pour les pages de vote (vote.php, recap.php, validation).
 *
 * Le design est volontairement simple et responsive pour s'adapter aux écrans
 * tactiles. Les cartes des choix sont de grande taille et peuvent être
 * déplacées facilement avec le doigt. Les boutons sont suffisamment grands
 * pour être activés aisément sur smartphone.
 */

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    min-height: 100vh;
    box-sizing: border-box;
}

h1 {
    font-size: 1.4em;
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
}

.error {
    color: #b00;
    margin-bottom: 10px;
}

form input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    display: inline-block;
    padding: 12px 20px;
    font-size: 1em;
    color: #fff;
    background: #007bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}

button:hover {
    background: #0056b3;
}

/* Liste triable */
.sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sortable-item {
    background: #e9f0f9;
    margin-bottom: 10px;
    padding: 15px;
    font-size: 1em;
    border: 1px solid #bcd;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.sortable-item .rank {
    display: inline-block;
    width: 1.8em;
    height: 1.8em;
    margin-right: 10px;
    background: #007bff;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 1.8em;
    font-weight: bold;
}

ol {
    margin-left: 1.2em;
    padding-left: 0;
}

ol li {
    margin-bottom: 5px;
}

/* Correctifs v5 : glisser-déposer tactile fiable */
html, body.is-dragging-choice {
    overscroll-behavior: none;
}

.sortable-list {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.sortable-item {
    position: relative;
    gap: 10px;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

.sortable-item.dragging {
    opacity: 0.96;
    transform: scale(1.03);
    box-shadow: 0 12px 28px rgba(0,0,0,0.24);
    border-color: var(--primary-color);
    background: #ffffff;
}

.sortable-placeholder {
    list-style: none;
    margin-bottom: 12px;
    border-radius: 8px;
    background: rgba(0, 97, 168, 0.12);
    border: 2px dashed var(--primary-color);
}

.move-actions {
    margin-left: auto;
    display: inline-flex;
    gap: 6px;
    flex-shrink: 0;
}

.move-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.05em;
    line-height: 1;
    background: #eef5ff;
    color: var(--primary-color);
    border: 1px solid #bfd7f0;
    box-shadow: none;
}

.move-btn:hover {
    background: #dcecff;
}

.choice-label {
    flex: 1;
}


/* Correctifs v8 : ergonomie smartphone avec beaucoup de choix */
.ranking-scroll {
    max-height: calc(100vh - 310px);
    overflow-y: auto;
    padding-right: 2px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* La liste peut défiler : seul le rang et la poignée lancent le drag */
.sortable-list {
    touch-action: pan-y;
}

.sortable-item {
    padding: 12px 12px;
    min-height: 58px;
    margin-bottom: 8px;
    touch-action: pan-y;
}

.sortable-item .rank {
    width: 2em;
    height: 2em;
    line-height: 2em;
    font-size: 0.95em;
    cursor: grab;
}

.drag-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 38px;
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 1.4em;
    font-weight: 700;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.choice-label {
    font-size: 0.98em;
    line-height: 1.25;
}

/* Bouton résumé visible et confortable sur mobile */
#summaryBtn {
    position: sticky;
    bottom: 12px;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 8px 20px rgba(0, 97, 168, 0.25);
}

/* Pendant le drag, on bloque le scroll pour que la carte suive bien le doigt */
body.is-dragging-choice .ranking-scroll,
body.is-dragging-choice .sortable-list,
body.is-dragging-choice .sortable-item {
    touch-action: none;
}

/* Les boutons de secours restent plus discrets pour gagner de la place */
.move-actions {
    gap: 4px;
}

.move-btn {
    width: 32px;
    height: 32px;
    font-size: 0.95em;
}

/* Sur très petits écrans, on réduit encore l'encombrement */
@media (max-width: 380px) {
    .container {
        padding: 14px;
    }
    .sortable-item {
        padding: 10px;
    }
    .choice-label {
        font-size: 0.95em;
    }
    .move-btn {
        width: 30px;
        height: 30px;
    }
}


/* Correctifs v9 : modale information choix */
.info-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 0;
    margin-left: 6px;
    flex-shrink: 0;
    background: #f1f7ff;
    color: var(--primary-color);
    border: 1px solid #bfd7f0;
    font-weight: 700;
    font-size: 1em;
    box-shadow: none;
}

.info-btn:hover {
    background: #dcecff;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    position: relative;
    animation: modalPop 0.16s ease-out;
}

.modal-card h2 {
    margin: 0 40px 12px 0;
    color: var(--primary-color);
    font-size: 1.2em;
}

.modal-card p {
    margin: 0;
    color: var(--text-color);
    white-space: pre-wrap;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    background: #eef2f7;
    color: #334155;
    border: 0;
    font-size: 1.4em;
    line-height: 1;
}

body.modal-open {
    overflow: hidden;
}

@keyframes modalPop {
    from {
        transform: scale(0.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* Correctifs v10 : indicateur de scroll et bouton vote */
.scroll-hint {
    position: sticky;
    top: 0;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 10px 0;
    padding: 9px 12px;
    border-radius: 999px;
    background: #fff7e6;
    color: #7a4b00;
    border: 1px solid #ffd88a;
    font-size: 0.92em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(122, 75, 0, 0.10);
}

.scroll-hint.visible {
    display: flex;
}

.scroll-hint span {
    display: inline-block;
    font-size: 1.1em;
    animation: scrollHintBounce 1s infinite;
}

@keyframes scrollHintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

#summaryBtn {
    font-size: 1.05em;
    font-weight: 700;
}


/* Correctifs v12 : page de validation définitive */
.confirmation-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(0, 169, 143, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(0, 97, 168, 0.18), transparent 34%),
        var(--background-color);
}

.success-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 22px;
    background: #ffffff;
    border-radius: 22px;
    text-align: center;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(0, 97, 168, 0.10);
}

.success-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 18px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(0, 169, 143, 0.28);
}

.success-card h1 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-size: 1.65em;
}

.success-message {
    font-size: 1.08em;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-color);
}

.success-info {
    padding: 14px;
    border-radius: 14px;
    background: #f6fafc;
    border: 1px solid #e3eef7;
    margin-bottom: 18px;
}

.success-info p {
    margin: 4px 0;
}

.success-footer {
    font-size: 0.85em;
    color: #64748b;
}


/* Correctifs v14 : animation résultats et exports */
.results-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin: 18px 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 97, 168, 0.10), rgba(0, 169, 143, 0.12));
    border: 1px solid rgba(0, 97, 168, 0.12);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.results-hero span {
    color: #64748b;
    font-size: 0.92em;
}

.results-trophy {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff7e6;
    border: 1px solid #ffd88a;
    font-size: 1.8em;
    animation: trophyPop 0.75s ease-out both;
}

.result-animated {
    opacity: 0;
    transform: translateY(12px);
    animation: resultRowIn 0.45s ease-out forwards;
}

.result-animated .bar {
    transform-origin: left center;
    animation: barGrow 0.8s ease-out both;
}

@keyframes resultRowIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes barGrow {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes trophyPop {
    0% {
        transform: scale(0.65) rotate(-8deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.12) rotate(4deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.result-container a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

.result-container a:hover {
    text-decoration: underline;
}


/* Correctifs v15 : résultats premium contemporains */
.result-modern {
    max-width: 980px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 26px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 0% 0%, rgba(0, 169, 143, 0.20), transparent 30%),
        radial-gradient(circle at 100% 0%, rgba(0, 97, 168, 0.18), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.results-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: #64748b;
    font-size: 0.84em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.result-modern h1 {
    margin-bottom: 6px;
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.results-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.results-metrics div {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(0, 97, 168, 0.10);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.results-metrics strong {
    display: block;
    font-size: 2.05em;
    color: var(--primary-color);
    line-height: 1;
}

.results-metrics span {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-weight: 700;
}

.result-modern .results-hero {
    background:
        linear-gradient(135deg, rgba(0, 97, 168, 0.12), rgba(0, 169, 143, 0.16)),
        rgba(255,255,255,0.74);
    backdrop-filter: blur(8px);
}

.result-modern .result-chart {
    display: grid;
    gap: 14px;
}

.result-modern .bar-row {
    display: grid;
    grid-template-columns: minmax(160px, 34%) 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.result-modern .bar-label {
    font-weight: 800;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.result-modern .bar-wrapper {
    height: 34px;
    border-radius: 999px;
    background: #eaf1f8;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.10);
}

.result-modern .bar {
    border-radius: 999px;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
}

.result-modern .bar-value {
    right: 12px;
    font-size: 0.92em;
    font-weight: 900;
    color: #0f172a;
    text-shadow: 0 1px 0 rgba(255,255,255,0.65);
}

.result-modern p a {
    display: inline-block;
    margin: 6px 6px 6px 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: #eef7ff;
    border: 1px solid #cfe7ff;
}

@media (max-width: 680px) {
    .result-modern {
        padding: 18px;
        border-radius: 0;
    }
    .results-topline {
        flex-direction: column;
        gap: 4px;
    }
    .results-metrics {
        grid-template-columns: 1fr;
    }
    .result-modern .bar-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .result-modern .bar-wrapper {
        height: 38px;
    }
}


/* PULSAR v16 : page résultats premium, moderne, responsive et fun */
.pulsar-results-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(109, 93, 246, 0.28), transparent 30%),
        radial-gradient(circle at top right, rgba(0, 191, 166, 0.24), transparent 32%),
        linear-gradient(135deg, #0f172a 0%, #111827 46%, #172554 100%);
    color: #0f172a;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.pulsar-results-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px;
}

.pulsar-results-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 22px;
    align-items: end;
    color: #ffffff;
    margin-bottom: 22px;
}

.pulsar-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.24);
    backdrop-filter: blur(12px);
    font-size: 0.78em;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.pulsar-results-header h1 {
    margin: 12px 0 4px;
    color: #ffffff;
    font-size: clamp(2.1rem, 5vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.pulsar-results-header p {
    margin: 0;
    color: rgba(255,255,255,0.78);
    font-size: 1.05em;
}

.pulsar-metrics {
    display: flex;
    gap: 12px;
}

.pulsar-metrics div {
    min-width: 110px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    color: #ffffff;
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}

.pulsar-metrics strong {
    display: block;
    font-size: 2em;
    line-height: 1;
}

.pulsar-metrics span {
    display: block;
    margin-top: 6px;
    color: rgba(255,255,255,0.74);
    font-weight: 700;
}

.pulsar-hero-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    align-items: center;
    padding: 22px;
    margin-bottom: 22px;
    border-radius: 30px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 24px 60px rgba(0,0,0,0.20);
    overflow: hidden;
}

.pulsar-hero-card h2 {
    margin: 0 0 6px;
    font-size: 1.7em;
    color: #111827;
}

.pulsar-hero-card p {
    margin: 0;
    color: #64748b;
    font-weight: 600;
}

.pulsar-orbit {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    position: relative;
    background: linear-gradient(135deg, #6D5DF6, #00BFA6);
    box-shadow: 0 16px 32px rgba(109, 93, 246, 0.35);
    animation: pulsarPulse 2.8s ease-in-out infinite;
}

.pulsar-orbit span {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45);
    animation: orbitSpin 4s linear infinite;
}

.pulsar-orbit span:nth-child(2) {
    inset: 28px;
    animation-duration: 2.8s;
    animation-direction: reverse;
}

.pulsar-orbit span:nth-child(3) {
    inset: 40px;
    background: #ffffff;
    border: 0;
    box-shadow: 0 0 22px rgba(255,255,255,0.9);
}

.pulsar-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.pulsar-podium-card {
    position: relative;
    min-height: 190px;
    padding: 20px;
    border-radius: 28px;
    color: #ffffff;
    box-shadow: 0 22px 55px rgba(0,0,0,0.22);
    overflow: hidden;
    transform: translateY(18px);
    opacity: 0;
    animation: podiumReveal 0.65s ease-out forwards;
}

.pulsar-podium-card.gold {
    background: linear-gradient(135deg, #FFB703, #FB8500);
}

.pulsar-podium-card.silver {
    background: linear-gradient(135deg, #94A3B8, #475569);
}

.pulsar-podium-card.bronze {
    background: linear-gradient(135deg, #C08457, #92400E);
}

.pulsar-podium-card::after {
    content: "";
    position: absolute;
    inset: auto -25% -45% auto;
    width: 190px;
    height: 190px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
}

.podium-rank {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.podium-medal {
    font-size: 2.4em;
    margin-bottom: 12px;
}

.pulsar-podium-card h3 {
    margin: 0 0 14px;
    font-size: 1.08em;
    line-height: 1.25;
    min-height: 52px;
}

.pulsar-podium-card p {
    margin: 0;
}

.pulsar-podium-card p strong {
    font-size: 2.2em;
}

.pulsar-podium-card span {
    display: inline-block;
    margin-top: 8px;
    font-weight: 800;
    color: rgba(255,255,255,0.82);
}

.pulsar-ranking-list {
    display: grid;
    gap: 12px;
}

.pulsar-rank-row {
    display: grid;
    grid-template-columns: 46px 1fr 96px;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(255,255,255,0.70);
    box-shadow: 0 14px 34px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(14px);
    animation: rowReveal 0.42s ease-out forwards;
}

.rank-number {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: #EEF2FF;
    color: #4F46E5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
}

.rank-title {
    font-weight: 850;
    margin-bottom: 8px;
    color: #111827;
}

.rank-bar-wrap {
    height: 14px;
    border-radius: 999px;
    background: #E5E7EB;
    overflow: hidden;
}

.rank-bar {
    height: 100%;
    border-radius: 999px;
    transform-origin: left center;
    animation: rankBarGrow 0.9s ease-out both;
}

.rank-score {
    text-align: right;
}

.rank-score strong {
    display: block;
    font-size: 1.55em;
    color: #111827;
    line-height: 1;
}

.rank-score span {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-weight: 750;
    font-size: 0.86em;
}

.pulsar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.pulsar-actions a {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.24);
    text-decoration: none;
    font-weight: 850;
    backdrop-filter: blur(12px);
    transition: transform 0.18s ease, background 0.18s ease;
}

.pulsar-actions a:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.22);
}

@keyframes pulsarPulse {
    0%, 100% { transform: scale(1); filter: saturate(1); }
    50% { transform: scale(1.06); filter: saturate(1.25); }
}

@keyframes orbitSpin {
    from { transform: rotate(0deg) scaleX(1.18); }
    to { transform: rotate(360deg) scaleX(1.18); }
}

@keyframes podiumReveal {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rowReveal {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rankBarGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@media (max-width: 820px) {
    .pulsar-results-shell {
        padding: 18px;
    }

    .pulsar-results-header {
        grid-template-columns: 1fr;
    }

    .pulsar-metrics {
        width: 100%;
    }

    .pulsar-metrics div {
        flex: 1;
    }

    .pulsar-hero-card {
        grid-template-columns: 1fr;
    }

    .pulsar-podium {
        grid-template-columns: 1fr;
    }

    .pulsar-rank-row {
        grid-template-columns: 40px 1fr;
    }

    .rank-score {
        grid-column: 2;
        text-align: left;
        display: flex;
        gap: 10px;
        align-items: baseline;
    }

    .pulsar-actions a {
        width: 100%;
        justify-content: center;
    }
}


/* PULSAR v17 : thème Assurance Maladie Hérault, smartphone et tablette */
:root {
    --primary-color: #004C97;
    --secondary-color: #80BC00;
    --am-blue: #004C97;
    --am-blue-dark: #003B78;
    --am-green: #80BC00;
    --am-green-soft: #EAF6D5;
    --am-sky: #EAF4FF;
    --background-color: #F5F8FC;
    --card-background: #FFFFFF;
    --text-color: #10233F;
}

/* Branding commun */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 22px;
    padding: 18px 12px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(128,188,0,.18), transparent 34%),
        linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 12px 28px rgba(0,76,151,.10);
}

.brand-header img {
    width: min(190px, 60vw);
    height: auto;
}

.brand-title {
    font-size: clamp(2rem, 12vw, 3.2rem);
    line-height: 1;
    letter-spacing: .04em;
    font-weight: 900;
    color: var(--am-blue);
}

.brand-header-compact {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px;
    margin-bottom: 14px;
}

.brand-header-compact img {
    width: 110px;
}

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

/* Page saisie numéro agent */
.vote-entry-screen {
    position: relative;
    overflow: hidden;
}

.vote-entry-screen::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(128,188,0,.22);
    z-index: 0;
}

.vote-entry-screen > * {
    position: relative;
    z-index: 1;
}

.vote-entry-screen h1,
.vote-ranking-screen h1 {
    color: var(--am-blue);
    font-weight: 850;
    letter-spacing: -.02em;
}

.vote-entry-screen button,
#summaryBtn {
    background: linear-gradient(135deg, var(--am-blue), var(--am-blue-dark));
    box-shadow: 0 10px 24px rgba(0,76,151,.22);
}

.vote-entry-screen button:hover,
#summaryBtn:hover {
    background: linear-gradient(135deg, var(--am-blue-dark), var(--am-blue));
}

.sortable-item .rank {
    background: var(--am-blue);
}

.drag-grip,
.info-btn,
.move-btn {
    color: var(--am-blue);
}

.scroll-hint {
    background: var(--am-green-soft);
    color: #355200;
    border-color: rgba(128,188,0,.35);
}

/* Administration */
.pulsar-admin-wrap {
    max-width: 1180px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(128,188,0,.18), transparent 32%),
        linear-gradient(135deg, #ffffff, #f7fbff);
    box-shadow: 0 12px 30px rgba(0,76,151,.10);
    border: 1px solid rgba(0,76,151,.08);
}

.admin-brand img {
    width: 150px;
    height: auto;
    flex-shrink: 0;
}

.admin-brand span {
    display: inline-block;
    color: var(--am-green);
    font-weight: 900;
    letter-spacing: .12em;
    font-size: .85em;
}

.admin-brand h1 {
    margin: 4px 0 0;
    color: var(--am-blue);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.admin-card {
    border: 1px solid rgba(0,76,151,.08) !important;
}

.pill-on {
    background: var(--am-green-soft) !important;
    color: #355200 !important;
}

/* Résultats PULSAR harmonisés logo */
.pulsar-results-body {
    background:
        radial-gradient(circle at top left, rgba(128,188,0,.22), transparent 28%),
        radial-gradient(circle at top right, rgba(0,76,151,.26), transparent 32%),
        linear-gradient(135deg, #002B5C 0%, #004C97 48%, #063970 100%);
}

.pulsar-result-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pulsar-result-brand img {
    width: 155px;
    height: auto;
    padding: 8px 12px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
}

.pulsar-badge {
    background: rgba(128,188,0,.18);
    border-color: rgba(128,188,0,.40);
}

.pulsar-orbit {
    background: linear-gradient(135deg, var(--am-blue), var(--am-green));
    box-shadow: 0 16px 32px rgba(0,76,151,.28);
}

.pulsar-podium-card.gold {
    background: linear-gradient(135deg, var(--am-green), #5E9900);
}

.pulsar-podium-card.silver {
    background: linear-gradient(135deg, #5C82B8, var(--am-blue));
}

.pulsar-podium-card.bronze {
    background: linear-gradient(135deg, #00A6D6, #006AA6);
}

.rank-number {
    background: var(--am-sky);
    color: var(--am-blue);
}

.pulsar-actions a {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.26);
}

/* Tablette et smartphone */
@media (max-width: 900px) {
    .admin-brand {
        align-items: flex-start;
    }

    .admin-brand img {
        width: 130px;
    }

    .brand-header-compact {
        flex-wrap: wrap;
    }

    .brand-header-compact img {
        width: 100px;
    }
}

@media (max-width: 600px) {
    .container {
        border-radius: 0;
        padding: 16px;
    }

    .brand-header {
        margin-top: 0;
        padding: 14px 10px;
    }

    .brand-header img {
        width: 155px;
    }

    .brand-header-compact {
        flex-direction: row;
        gap: 10px;
    }

    .brand-header-compact img {
        width: 92px;
    }

    .brand-header-compact .brand-title {
        font-size: 1.25rem;
    }

    .admin-brand {
        flex-direction: column;
        text-align: left;
    }

    .admin-brand img {
        width: 145px;
    }

    .pulsar-result-brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .pulsar-result-brand img {
        width: 135px;
    }
}


/* PULSAR v18 : harmonisation globale Assurance Maladie / Hérault */
html, body {
    background: #F5F8FC;
    color: #10233F;
}

body {
    background:
        radial-gradient(circle at top right, rgba(128,188,0,.10), transparent 28%),
        radial-gradient(circle at bottom left, rgba(0,76,151,.08), transparent 30%),
        #F5F8FC;
}

.container,
.admin-card,
.success-card,
.result-container,
.pulsar-results-shell {
    background: #FFFFFF;
}

/* Logo + nom plus sobres */
.brand-header,
.admin-brand {
    background: #FFFFFF;
    border: 1px solid rgba(0,76,151,.10);
    box-shadow: 0 8px 26px rgba(0,76,151,.08);
}

.brand-header {
    gap: 8px;
    padding: 14px;
}

.brand-header img {
    width: min(165px, 52vw);
}

.brand-title {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    color: #004C97;
    letter-spacing: .08em;
}

.brand-header-compact {
    flex-direction: row;
    justify-content: flex-start;
}

.brand-header-compact img {
    width: 100px;
}

.brand-header-compact .brand-title {
    font-size: 1.3rem;
}

/* Administration harmonisée */
.admin-wrap {
    background: transparent;
}

.admin-brand {
    align-items: center;
    border-radius: 18px;
    padding: 16px;
}

.admin-brand img {
    width: 135px;
}

.admin-brand span {
    color: #80BC00;
}

.admin-brand h1 {
    color: #004C97;
}

/* Résultats : fond allégé et cohérent */
.pulsar-results-body {
    background:
        radial-gradient(circle at top right, rgba(128,188,0,.13), transparent 30%),
        radial-gradient(circle at bottom left, rgba(0,76,151,.10), transparent 32%),
        #F5F8FC !important;
    color: #10233F;
}

.pulsar-results-shell {
    max-width: 1120px;
    background: transparent;
    box-shadow: none;
}

.pulsar-results-header {
    color: #10233F;
    background: #FFFFFF;
    border: 1px solid rgba(0,76,151,.10);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 12px 32px rgba(0,76,151,.08);
}

.pulsar-result-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pulsar-result-brand img {
    width: 140px;
    height: auto;
    background: #FFFFFF;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}

.pulsar-badge {
    display: inline-flex;
    padding: 6px 10px;
    color: #004C97;
    background: #EAF4FF;
    border: 1px solid rgba(0,76,151,.16);
}

.pulsar-results-header h1 {
    color: #004C97;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    font-size: clamp(1.8rem, 4.5vw, 3.1rem);
    letter-spacing: -.04em;
    margin: 8px 0 4px;
}

.pulsar-results-header p {
    color: #5D6B82;
}

.pulsar-metrics div {
    background: #F7FBFF;
    color: #10233F;
    border: 1px solid rgba(0,76,151,.10);
    box-shadow: none;
}

.pulsar-metrics span {
    color: #5D6B82;
}

.pulsar-podium-card {
    box-shadow: 0 14px 36px rgba(0,76,151,.14);
}

.pulsar-rank-row {
    border: 1px solid rgba(0,76,151,.09);
    box-shadow: 0 10px 28px rgba(0,76,151,.08);
}

.pulsar-actions a {
    background: #FFFFFF;
    color: #004C97;
    border: 1px solid rgba(0,76,151,.18);
    box-shadow: 0 8px 18px rgba(0,76,151,.07);
}

.pulsar-actions a:hover {
    background: #EAF4FF;
}

/* Bouton résultat après validation */
.success-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    background: #004C97;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 800;
}

.check-option {
    display: block;
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    background: #F7FBFF;
    border: 1px solid rgba(0,76,151,.10);
}

/* Tablette et smartphone */
@media (max-width: 820px) {
    .pulsar-results-shell {
        padding: 14px;
    }

    .pulsar-results-header {
        grid-template-columns: 1fr;
    }

    .pulsar-result-brand {
        align-items: flex-start;
    }

    .pulsar-metrics {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .brand-header img {
        width: 145px;
    }

    .brand-title {
        font-size: 2rem;
    }

    .admin-brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-brand img {
        width: 130px;
    }

    .pulsar-result-brand {
        flex-direction: column;
        gap: 10px;
    }

    .pulsar-result-brand img {
        width: 130px;
    }

    .pulsar-metrics {
        grid-template-columns: 1fr;
    }

    .pulsar-results-header h1 {
        font-size: 1.8rem;
    }
}


/* Harmonisation en-tête résultats */
.results-brand-bar {
    display: flex;
    align-items: center;
    gap: 18px;
}

.results-brand-bar img {
    width: 145px;
    height: auto;
    flex-shrink: 0;
}

.results-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.results-brand-text span {
    color: #80BC00;
    font-weight: 900;
    letter-spacing: .12em;
    font-size: .82em;
}

.results-brand-text strong {
    color: #004C97;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -.03em;
}

.results-brand-text small {
    color: #5D6B82;
    font-size: .95em;
    font-weight: 600;
}

.pulsar-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

@media (max-width: 820px) {
    .pulsar-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .results-brand-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .results-brand-bar img {
        width: 130px;
    }

    .results-brand-text strong {
        font-size: 1.7rem;
    }
}




/* PULSAR v22 : correction finale scroll vote et rang dynamique */
.ranking-scroll {
    max-height: calc(100dvh - 300px);
    overflow-y: auto;
    padding-bottom: 0 !important;
    scroll-padding-bottom: 180px;
}

.sortable-list {
    padding-bottom: 180px !important;
}

.sortable-list::after {
    content: "";
    display: block;
    height: 180px !important;
    flex: 0 0 180px;
}

.vote-ranking-screen form {
    padding-bottom: 130px !important;
}

#summaryBtn {
    position: sticky;
    bottom: 12px;
    z-index: 30;
    width: 100%;
    margin-top: 8px;
    border: 3px solid #ffffff;
    box-shadow: 0 10px 26px rgba(0, 76, 151, .22);
}

.sortable-placeholder {
    min-height: 58px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(128,188,0,.18);
    border: 2px dashed #80BC00;
}

.sortable-item.dragging .rank {
    background: #80BC00;
    color: #10233F;
    box-shadow: 0 0 0 4px rgba(128,188,0,.18);
}
