/*
    Thème Assurance Maladie CPAM - LimeSurvey 6
    Design moderne et corporate aux couleurs officielles de l'Assurance Maladie.

    ████████╗██╗  ██╗███████╗███╗   ███╗███████╗     ██████╗██████╗  █████╗ ███╗   ███╗
       ██╔══╝██║  ██║██╔════╝████╗ ████║██╔════╝    ██╔════╝██╔══██╗██╔══██╗████╗ ████║
       ██║   ███████║█████╗  ██╔████╔██║█████╗      ██║     ██████╔╝███████║██╔████╔██║
       ██║   ██╔══██║██╔══╝  ██║╚██╔╝██║██╔══╝      ██║     ██╔═══╝ ██╔══██║██║╚██╔╝██║
       ██║   ██║  ██║███████╗██║ ╚═╝ ██║███████╗    ╚██████╗██║     ██║  ██║██║ ╚═╝ ██║
       ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝     ╚═╝╚══════╝     ╚═════╝╚═╝     ╚═╝  ╚═╝╚═╝     ╚═╝

    Assurance Maladie - CPAM
    Version: 1.0.0
*/

/* =================================================================
   Police Cabin Variable — police officielle charte AM 2021 (locale)
   ================================================================= */

@font-face {
    font-family: 'Cabin';
    src: url('../files/fonts/cabin-variable.woff2') format('woff2-variations');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

/* =================================================================
   Variables du Design System CPAM
   ================================================================= */

:root {
    /* Palette officielle Assurance Maladie (charte graphique) */
    --cpam-primary:         #0C419A;   /* Bleu AM — Pantone 293 */
    --cpam-primary-dark:    #092E6E;   /* Bleu foncé — survol, actif */
    --cpam-primary-medium:  #3A65B4;   /* Bleu moyen — secondaire */
    --cpam-primary-light:   #B8CAE8;   /* Bleu clair — bordures, accents */
    --cpam-primary-xlight:  #EBF0F9;   /* Bleu très clair — fonds de sections */

    /* Couleurs complémentaires officielles */
    --cpam-cyan:            #00A5DF;   /* Cyan — Pantone 2202 */
    --cpam-turquoise:       #00ABBE;   /* Turquoise — Pantone 3268 */
    --cpam-vert:            #56C271;   /* Vert — Pantone 2256 */
    --cpam-gris:            #545859;   /* Gris — Pantone 425 */

    /* Neutres */
    --cpam-white:           #FFFFFF;
    --cpam-text:            #1A1A2E;
    --cpam-text-muted:      #545859;   /* Gris officiel AM */
    --cpam-border:          #D0DCF1;
    --cpam-border-strong:   #B8CAE8;
    --cpam-bg-page:         #F0F4FB;   /* Fond page légèrement bleu */
    --cpam-bg-card:         #FFFFFF;
    --cpam-bg-hover:        #E8EDF8;

    /* Couleurs sémantiques (issues de la charte) */
    --cpam-warning:         #F0B323;   /* Jaune — Pantone 7409 */
    --cpam-warning-bg:      #FEF8E7;
    --cpam-danger:          #E04F39;   /* Brique — Pantone 7417 */
    --cpam-danger-bg:       #FDECEA;

    /* Typographie */
    --cpam-font:            'Cabin', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --cpam-font-size-base:  16px;
    --cpam-line-height:     1.6;

    /* Bordures arrondies */
    --cpam-radius-sm:       4px;
    --cpam-radius-md:       8px;
    --cpam-radius-lg:       12px;
    --cpam-radius-pill:     50px;

    /* Ombres teintées bleu AM */
    --cpam-shadow-sm:       0 1px 3px rgba(12, 65, 154, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --cpam-shadow-md:       0 4px 12px rgba(12, 65, 154, 0.10), 0 2px 4px rgba(0, 0, 0, 0.06);
    --cpam-shadow-focus:    0 0 0 3px rgba(12, 65, 154, 0.25);

    /* Transitions */
    --cpam-transition:      0.2s ease-in-out;
}

/* =================================================================
   Base & Typographie
   ================================================================= */

body {
    font-family: var(--cpam-font);
    font-size: var(--cpam-font-size-base);
    line-height: var(--cpam-line-height);
    padding-bottom: 10px;
    padding-top: 90px; /* redéfini en JS selon la hauteur du titre */
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--cpam-font);
    font-weight: 600;
    line-height: 1.3;
}

label {
    font-weight: 500;
}

/* =================================================================
   Navbar (barre de navigation supérieure)
   ================================================================= */

html body .navbar.navbar-default.navbar-fixed-top {
    z-index: 2000;
    background-color: var(--cpam-white) !important;
    border-bottom: 3px solid var(--cpam-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 0 !important;
}

.file-upload-modal, .modal {
    z-index: 2001;
}

/* Titre du sondage dans la navbar - multi-ligne supporté */
.navbar-brand {
    height: auto;
    min-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--cpam-primary) !important;
    font-weight: 600;
}

/* Lien survol dans la navbar */
.navbar-default .navbar-nav > li > a:hover {
    text-decoration: none;
    color: var(--cpam-primary-dark);
}

.navbar-action-link {
    padding-right: 1em;
}

/* --------- Logo --------- */
.logo-container {
    padding: 0;
    float: left;
    font-size: 18px;
    line-height: 20px;
}

.logo-container > img {
    max-height: 90px;
    padding: 12px 15px;
    width: auto;
}

.brand-logo .top-container .top-content {
    padding-top: 2em;
}

/* --------- Underline animée sur les nav items (grand écran) --------- */
@media (min-width: 769px) {
    .cpam .navbar .navbar-nav .nav-item {
        position: relative;
    }
    .cpam .navbar .navbar-nav .nav-item::after {
        content: '';
        display: block;
        height: 3px;
        background-color: var(--cpam-primary);
        width: 0;
        transition: width var(--cpam-transition);
        text-align: right;
    }
    .cpam .navbar .navbar-nav .nav-item:hover::after {
        width: 100%;
    }
    .cpam .navbar .navbar-nav .nav-item .nav-link {
        padding-bottom: 0;
        padding-left: 0;
    }
    .cpam .navbar .navbar-nav .nav-item .nav-link:active,
    .cpam .navbar .navbar-nav .nav-item .nav-link:focus,
    .cpam .navbar .navbar-nav .nav-item .nav-link:hover {
        text-decoration: none;
    }
}

/* --------- Navbar mobile --------- */
@media (max-width: 768px) {
    html body .navbar.navbar-default.navbar-fixed-top {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .cpam .navbar {
        box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.08);
        padding-bottom: 15px;
        padding-top: 15px;
    }
}

/* Bouton hamburger mobile */
.cpam .navbar-toggle {
    border: 1px solid var(--cpam-primary);
    border-radius: var(--cpam-radius-sm);
    background-color: var(--cpam-white);
}
.cpam .navbar-toggle .icon-bar {
    background-color: var(--cpam-primary);
}

/* =================================================================
   Conteneur principal & Barre de progression
   ================================================================= */

.top-container {
    width: 100%;
    padding: 0;
    border-bottom: none;
    color: inherit;
}

.top-container .top-content {
    padding-top: 1.25em;
    padding-bottom: 1.25em;
    margin-bottom: 2em;
}

.top-content .form-change-lang { float: right; }
.dir-rtl .top-content .form-change-lang { float: left; }
.no-js .top-content .form-change-lang { display: none; }
.top-container .top-content:empty { display: none; }
.group-description:empty { display: none; }
.group-title:empty { display: none; }

/* Barre de progression */
.top-container .progress {
    height: 21px;
    margin-bottom: 0;
    border-radius: var(--cpam-radius-pill);
    overflow: hidden;
}
.progress .progress-bar {
    line-height: 19px;
}

.top-container .form-change-lang { text-align: center; }

/* =================================================================
   Groupes de questions
   ================================================================= */

.group-outer-container {
    display: flex;
}

.group-container {
    width: 100%;
}

.group-title-container {
    padding: 1em;
    background: transparent;
}

/* Accent vert sur le titre de groupe */
.group-title-container .h3,
.group-title-container h3 {
    border-left: 4px solid var(--cpam-primary);
    padding-left: 12px;
    margin-top: 0;
}

/* =================================================================
   Conteneurs de questions (cartes modernes)
   ================================================================= */

.question-container {
    margin-bottom: 1.5em;
    border-radius: var(--cpam-radius-md);
    box-shadow: var(--cpam-shadow-sm);
    border: 1px solid transparent;
    transition:
        box-shadow var(--cpam-transition),
        border-color var(--cpam-transition);
}

/* Effet d'activation quand on interagit avec la question */
.question-container:focus-within {
    box-shadow: var(--cpam-shadow-md);
    border-color: var(--cpam-primary-light);
}

.question-container-printanswers {
    margin-top: 2em;
    margin-bottom: 2em;
    padding-bottom: 2em;
    border-bottom: 1px solid var(--cpam-border-strong);
}

.question-title-container {
    padding-top: 1.25em;
    padding-bottom: 0.75em;
    background: none;
    border: none;
}

.question-number, .question-code {
    float: left;
    margin: 0 0.4em;
    color: var(--cpam-primary);
    font-weight: 700;
}
.question-number:empty, .question-code:empty { display: none; }

.question-valid-container {
    position: relative;
    background: none;
    border: none;
}

.question-valid-container .text-danger {
    font-weight: 600;
}

.question-valid-container .text-info {
    font-weight: 600;
}

/* Zones bordées */
.answer-container, .question-help-container {
    border-color: var(--cpam-border-strong);
}

.answer-container {
    border-width: 0 1px 0 1px;
    border-style: solid;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    border: none;
}

/* Icône d'aide à gauche du texte */
.ls-questionhelp {
    margin-bottom: 5px;
    color: var(--cpam-text-muted);
    font-size: 0.9rem;
    position: relative;
}

.dir-ltr .ls-questionhelp { margin-left: 1.2em; }
.dir-rtl .ls-questionhelp { margin-right: 1.2em; }

.ls-questionhelp::before {
    content: "\f059";
    display: block;
    position: absolute;
    font-family: FontAwesome;
    font-size: inherit;
    line-height: inherit;
    height: 100%;
    color: var(--cpam-primary-medium);
}

.dir-ltr .ls-questionhelp::before { left: -1.1em; }
.dir-rtl .ls-questionhelp::before { right: -1.1em; }

/* Erreur de saisie sur une question */
.question-container.input-error {
    border-color: var(--cpam-danger);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.input-error .asterisk {
    font-size: 1.2em;
    margin-top: -0.2em;
}

/* =================================================================
   Navigateur (Précédent / Suivant / Envoyer)
   ================================================================= */

#navigator-container {
    padding-bottom: 1em;
    padding-top: 0.5em;
}

#navigator-container > hr {
    margin-top: 0;
    margin-bottom: 0;
    border-color: var(--cpam-border-strong);
}

/* Aligner les boutons avec les bords des questions */
#navigator-container > div {
    padding: 0;
}

/* =================================================================
   Boutons
   ================================================================= */

.btn {
    font-family: var(--cpam-font);
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--cpam-radius-sm);
    transition: all var(--cpam-transition);
    cursor: pointer;
}

/* Bouton principal (Suivant, Envoyer) — style pill arrondi */
.btn-primary {
    border-radius: var(--cpam-radius-pill);
    font-weight: 600;
}

/* Focus accessible (anneau vert) */
.btn:focus,
.btn:active:focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn.active.focus,
.btn-primary:focus {
    outline: none;
    box-shadow: var(--cpam-shadow-focus);
}

/* Couleur texte blanc au survol */
.btn-danger:hover,
.btn-info:hover,
.btn-success:hover,
.btn-warning:hover,
.btn:focus,
.btn:hover {
    color: #fff;
}

/* Focus radio/checkbox */
.radio-item input[type="radio"]:focus + label::before,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
    outline: none;
    box-shadow: var(--cpam-shadow-focus);
}

/* Coche cochée — fond transparent (couleur gérée dans cpam.css) */
.checkbox-item input[type="checkbox"]:checked + label::before {
    border: none;
    background-color: transparent;
    outline: none;
}

/* =================================================================
   Formulaires
   ================================================================= */

.form-control {
    font-family: var(--cpam-font);
    border-radius: var(--cpam-radius-sm);
    height: auto;
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    transition:
        border-color var(--cpam-transition),
        box-shadow var(--cpam-transition);
}

/* Étiquettes */
label {
    font-weight: 500;
}

/* Retour visuel date-picker */
.form-control-feedback {
    right: 1em;
    left: auto;
}

/* Utiliser <label> pour l'alignement vertical sans gras */
.no-label {
    font-weight: normal;
}

/* =================================================================
   Tables et réponses
   ================================================================= */

.ls-answers {
    padding-top: 15px;
    padding-bottom: 15px;
    margin-bottom: 0;
}

/* En-têtes de colonnes discrets */
.ls-answers .ls-heading th {
    font-weight: 600;
}

/* Lignes paires — fond très légèrement vert */
.ls-even {
    background-color: var(--cpam-primary-xlight);
}

/* Hover colonne dans les matrices */
.table-col-hover col:hover,
.table-col-hover col.hover {
    background-color: var(--cpam-bg-hover);
}

/* Pas de hover sur mobile */
@media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) {
    .ls-answers > tbody > tr.ls-even:hover {
        background-color: var(--cpam-primary-xlight);
    }
}

/* Aligner les th verticalement */
.table > tbody > tr > th {
    vertical-align: middle;
}

/* Groupes dynamiques */
.ls-group-dynamic .form-control-static {
    border: 2px solid transparent;
    padding-left: 15px;
    padding-right: 15px;
}

/* Tableau double-échelle */
@media only screen and (min-width: 761px) {
    .table-dual-scale .separator {
        width: 6%;
    }
    table > tbody > tr > td.ddsuffix {
        padding-left: 1em;
        vertical-align: middle;
    }
}

table > tbody > tr > td.ddprefix {
    padding-right: 1em;
    vertical-align: middle;
}

/* =================================================================
   Alertes — style flat avec bordure gauche colorée
   ================================================================= */

.alert {
    background: none;
    border-left-width: 4px;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-radius: var(--cpam-radius-sm);
    font-weight: 500;
}

/* Flash messages Yii */
#yii-flash-message {
    margin-top: 3em;
}

/* =================================================================
   Sliders
   ================================================================= */

.slider-item {
    margin-bottom: 20px;
    min-height: 50px;
}

.slider-container {
    min-height: 15px;
}

/* =================================================================
   Liste des sondages (page d'accueil)
   ================================================================= */

@media (min-width: 761px) {
    .surveys-list .btn-group {
        width: 49%;
    }
}

.surveys-list {
    margin-top: 1em;
    list-style: none;
}

.surveys-list li {
    padding: 0.5em;
}

.surveys-list li a {
    margin-left: 0.5em;
}

#surveys-list-jumbotron {
    text-align: center;
}

#surveys-list-jumbotron img.site-surveylist-logo {
    max-width: 35%;
    display: block;
    margin: 15px auto;
}

#surveys-list-container {
    margin-top: 50px;
}

#surveyListFooter {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    padding-bottom: 80px;
    padding-top: 10px;
    margin-top: 10px;
    bottom: 0;
    height: 60px;
    background-color: rgba(232, 245, 241, 0.5);
}

@media (max-width: 768px) {
    #surveyListFooter {
        padding-bottom: 40px;
        padding-top: 5px;
        margin-top: 5px;
        height: 40px;
    }
}

/* =================================================================
   Responsive mobile
   ================================================================= */

@media only screen and (max-device-width: 760px) {

    h1, .h3 { font-size: 18px; }
    .h4 { font-size: 16px; }

    .question-container {
        margin-bottom: 1em;
        border-radius: var(--cpam-radius-sm);
    }

    .question-title-container {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .ls-questionhelp { font-size: 14px; }

    .table-bordered { border: none; }

    .ls-answers tbody:last-child tr:last-child { margin-bottom: 0; }

    .ls-answers {
        padding-top: 0;
        padding-bottom: 0;
    }

    .ls-answers > tbody > tr > td.radio-item,
    .ls-answers > tbody > tr > td.checkbox-item {
        min-height: 44px;
        padding-top: 10px;
        padding-left: 28px;
    }

    .ls-answers.table > tbody + tbody {
        border-top: none;
    }

    .help-block:last-child { margin-bottom: 0; }

    .ls-questionhelp,
    .help-block { font-size: 90%; }
}

/* Boutons Oui/Non et genre */
@media (min-width: 768px) {
    .yesno-button, .gender-button {
        width: 50%;
        float: left;
    }
    .dir-rtl .yesno-button, .dir-rtl .gender-button {
        float: right;
    }
}

/* =================================================================
   Utilitaires et divers
   ================================================================= */

.space-col {
    margin-top: 1em;
    margin-bottom: 2em;
}

.col-centered {
    float: none;
    margin: 0 auto;
}

.radio-list li {
    display: block;
    clear: both;
    margin-right: 3rem;
}

.question-item .other-label {
    margin: 0;
    padding: 0;
}

/* Masquer le tip em-type */
.hide-tip { display: none; }

/* Modale — centrage vertical */
.modal {
    text-align: center;
    padding: 0 !important;
}
.modal:before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -4px;
}
.modal-dialog {
    display: inline-block;
    text-align: left;
    vertical-align: middle;
}

.prefix-text-right { text-align: right; }
.align-middle { vertical-align: middle !important; }

/* Elément de formulaire en réponse autre */
.othertext-label-checkox-container {
    padding-top: 5px;
    margin-right: 5px;
}

.geoname_search { margin-bottom: 10px; }

/* Aide de question */
.questionhelp { padding-bottom: 0.5em; }

/* En-tête de confidentialité */
.privacy-header {
    font-weight: bold;
    font-style: italic;
}

/* Séparateurs */
.horizontal-divider.top { border-top: 3px solid #323232; }
.horizontal-divider.bottom { border-bottom: 3px solid #323232; }
.vertical-divider.left { border-left: 3px solid #323232; }
.vertical-divider.right { border-right: 3px solid #323232; }

@media (max-width: 800px) {
    .vertical-divider.left,
    .vertical-divider.right { border: none; }
}

/* Wrapping normal du texte (ex: bouton "Sans réponse") */
.wrap-normal { white-space: normal; }

/* Empreinte de mise en page (hyphénation) */
#outerframeContainer {
    min-height: 100%;
    word-wrap: break-word;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

/* Xdebug */
.xdebug-var-dump {
    z-index: 10000;
    position: relative;
    top: 10px;
}

/* Labels Oui/Non */
div.yes-no .btn-group label { white-space: normal; }

/* Menu d'index des questions */
#index-menu ul.dropdown-menu {
    max-height: 50vh;
    overflow-y: scroll;
}

/* Préformatage */
.text-break-pre { white-space: pre-line; }

/* Espacement des enfants de row */
.child-row-spacing > .row { padding-bottom: 8px; }
.child-row-border-bottom > .row:last-child { padding-bottom: 0; }

/* Exposant */
.superset {
    font-size: 50%;
    vertical-align: top;
}

/* Boutons type icône */
.button-item .ls-icon,
.ls-button-label .ls-icon {
    display: block;
    font-size: 1.4em;
    line-height: 1.4em;
}

/* Fenêtre de texte limité */
.limit-text-window {
    max-height: 40rem;
    max-height: 33vh;
    padding: 15px 5px;
    overflow: auto;
    border-top: 1px solid var(--cpam-border-strong);
    border-bottom: 1px solid var(--cpam-border-strong);
    border-left: none;
    border-right: none;
    outline: none;
}

/* Retour au sondage */
p.return-to-survey { clear: left; }

/* Checkbox — fond transparent (couleur dans cpam.css) */
body .checkbox-item label::after {
    background-color: transparent;
}

/* Main column */
#main-col { margin-top: 1em; }

/* #navbar minimaliste */
#navbar { background: none; border: none; }
.question-title-container, .question-valid-container { background: none; border: none; }
.answer-container, .question-container { border: none; }
.navbar-default .navbar-brand, .navbar-default { border: none; }
.question-item { border: none; }
