:root {
    --svci-blue: #0055A4;
    --svci-red: hsl(56, 100%, 59%);
    --svci-white: #FFFFFF;
    --svci-black: #000000;
    --svci-light-bg: #fbfdff;
    --svci-green: #18b43c;
    --svci-gold: #FFD700;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Éviter le scroll horizontal */
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--svci-black);
    background-color: var(--svci-white);
    overflow-x: hidden;
    /* Éviter le scroll horizontal */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Conteneur responsive */
.container {
    width: 100%;
    max-width: 1200px;
    padding-left: 15px;
    padding-right: 15px;
    margin: 0 auto;
}

/* Fix pour les rows Bootstrap */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100%;
}

.col,
[class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Amélioration des interactions tactiles */
button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Fix global pour éviter le débordement */
section,
div,
header,
footer,
main {
    max-width: 100%;
    box-sizing: border-box;
}

.btn-svci {
    background-color: #ee8002;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 1.1rem;
}

.btn-svci:hover {
    background-color: #f58300d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.page-header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    text-align: center;
}

.page-header .container {
    max-width: 100%;
}

/* Désactiver parallaxe sur mobile pour améliorer les performances */
@media (max-width: 768px) {
    .page-header {
        background-attachment: scroll;
    }
}

.section-title {
    position: relative;
    margin-bottom: 40px;
    padding-bottom: 15px;
    text-align: center;
    color: var(--svci-blue);
    font-weight: 700;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--svci-red);
}

.form-section {
    padding: 80px 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.form-section .container {
    max-width: 1200px;
    width: 100%;
}

.form-card {
    background: var(--svci-white);
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    max-width: 100%;
    overflow: hidden;
}

.form-label {
    font-weight: 600;
    color: var(--svci-blue);
    margin-bottom: 8px;
}

.form-control,
.form-select {
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    font-size: 1rem;
    width: 100%;
    background-color: #ffffff;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230055A4' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

.form-select[size] {
    height: auto !important;
    min-height: 150px;
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
    background-image: none;
}

.form-select[size].has-selection {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-select option {
    padding: 10px 12px;
    border-radius: 4px;
    margin: 2px 0;
    transition: background-color 0.2s;
}

.form-select optgroup {
    font-weight: 700;
    color: var(--svci-blue);
    font-size: 0.95rem;
    padding: 8px 4px;
    margin-top: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.form-select option:hover,
.form-select option:focus {
    background-color: #f0f7ff;
}

.form-select option[disabled] {
    color: #999;
    font-style: italic;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--svci-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 85, 164, 0.15);
    outline: none;
}

/* Amélioration pour mobile */
@media (max-width: 768px) {

    .form-control,
    .form-select {
        font-size: 16px;
        /* Évite le zoom automatique sur iOS */
        padding: 10px 12px;
    }

    textarea.form-control {
        min-height: 100px;
    }
}

.required-field::after {
    content: " *";
    color: var(--svci-red);
}

/* Styles pour les champs de recherche des listes */
input[id$="_search"] {
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 15px 10px 35px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 16px;
}

input[id$="_search"]:focus {
    background-color: #ffffff;
    border-color: var(--svci-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 85, 164, 0.15);
    outline: none;
}

input[id$="_search"]::placeholder {
    color: #999;
}

/* Texte d'aide sous les listes */
.text-muted,
small.text-muted {
    color: #6c757d !important;
    font-size: 0.875rem;
    display: block;
    margin-top: 6px;
    font-style: italic;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* Ajustement responsive pour les checkboxes */
@media (max-width: 768px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scrollbar personnalisée pour les listes déroulantes */
.form-select[size]::-webkit-scrollbar {
    width: 8px;
}

.form-select[size]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.form-select[size]::-webkit-scrollbar-thumb {
    background: var(--svci-blue);
    border-radius: 4px;
    transition: background 0.3s;
}

.form-select[size]::-webkit-scrollbar-thumb:hover {
    background: #003d7a;
}

/* Pour Firefox */
.form-select[size] {
    scrollbar-width: thin;
    scrollbar-color: var(--svci-blue) #f1f1f1;
}

/* Animation pour les champs de formulaire */
.form-control,
.form-select {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Espacement pour les colonnes de formulaire */
.mb-3 {
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-check-input:checked {
    background-color: var(--svci-blue);
    border-color: var(--svci-blue);
}

.benefits-section {
    padding: 80px 0;
    background-color: var(--svci-light-bg);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.benefit-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--svci-white);
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    height: 100%;
    max-width: 100%;
}

.benefit-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.benefit-icon {
    font-size: 2.5rem;
    color: var(--svci-red);
    margin-bottom: 20px;
}

.benefit-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--svci-blue);
}

.temoignage-section {
    padding: 80px 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.temoignage-card {
    background: var(--svci-white);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
}

.temoignage-card:before {
    content: '"';
    font-size: 5rem;
    color: var(--svci-light-bg);
    position: absolute;
    top: 10px;
    left: 20px;
    line-height: 1;
}

.temoignage-text {
    font-style: italic;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
}

.temoignage-author {
    font-weight: 600;
    color: var(--svci-blue);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.temoignage-role {
    color: var(--svci-red);
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.faq-section {
    padding: 80px 0;
    background-color: var(--svci-light-bg);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.accordion-button:not(.collapsed) {
    background-color: var(--svci-blue);
    color: white;
}

.accordion-button:focus {
    border-color: var(--svci-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 85, 164, 0.25);
}

.footer {
    background-color: var(--svci-black);
    color: white;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    padding: 50px 0 20px;
}

.footer-title {
    font-weight: bold;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
    color: var(--svci-white);
    font-size: 1.2rem;
}

.footer-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--svci-red);
}

.footer-links a {
    color: #DDD;
    text-decoration: none;
    display: block;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--svci-red);
    padding-left: 5px;
}

.social-icons a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    color: white;
    margin-right: 10px;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: var(--svci-red);
    color: white;
    transform: translateY(-3px);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 40px;
    text-align: center;
    color: #AAA;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablettes et petits écrans (max-width: 992px) */
@media (max-width: 992px) {
    body {
        max-width: 100vw;
    }

    .container {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .page-header {
        padding: 70px 0;
        max-width: 100vw;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .page-header .lead {
        font-size: 1rem;
    }

    .form-section,
    .benefits-section,
    .temoignage-section,
    .faq-section {
        padding: 60px 0;
        max-width: 100vw;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .form-card {
        padding: 30px 20px;
        margin-left: 0;
        margin-right: 0;
    }

    .checkbox-group {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 8px;
    }

    .benefit-card {
        padding: 25px 15px;
        margin-bottom: 20px;
    }

    .benefit-icon {
        font-size: 2rem;
    }
}

/* Mobiles (max-width: 768px) */
@media (max-width: 768px) {

    html,
    body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    * {
        max-width: 100%;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
        margin-left: 0;
        margin-right: 0;
    }

    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar-brand img {
        height: 40px;
    }

    .nav-link {
        margin: 5px 0;
    }

    .page-header {
        padding: 50px 10px;
        margin: 0;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .lead {
        font-size: 0.95rem;
    }

    .page-header .btn {
        margin-top: 15px;
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    .form-section,
    .benefits-section,
    .temoignage-section,
    .faq-section {
        padding: 40px 10px;
        margin: 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .section-title:after {
        width: 60px;
        height: 3px;
    }

    .form-card {
        padding: 15px 10px;
        border-radius: 8px;
        margin-left: 0;
        margin-right: 0;
    }

    .form-card h5 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .form-control,
    .form-select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .form-check {
        margin-bottom: 8px;
    }

    .btn-svci {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .benefit-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .benefit-icon {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .benefit-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .temoignage-card {
        padding: 20px 15px;
        margin-bottom: 20px;
        overflow: hidden;
        word-wrap: break-word;
    }

    .temoignage-card:before {
        font-size: 3rem;
        top: 5px;
        left: 10px;
    }

    .temoignage-text {
        font-size: 0.95rem;
        margin-bottom: 15px;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .temoignage-author {
        font-size: 0.95rem;
    }

    .temoignage-role {
        font-size: 0.85rem;
    }

    .accordion-button {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .accordion-body {
        padding: 15px;
        font-size: 0.9rem;
    }

    .footer {
        padding: 30px 0 15px;
    }

    .footer-title {
        font-size: 1rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .footer-title:after {
        width: 30px;
        height: 2px;
    }

    .footer-links a {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .social-icons a {
        width: 35px;
        height: 35px;
        line-height: 35px;
        margin-right: 8px;
    }

    .copyright {
        font-size: 0.85rem;
        padding-top: 15px;
        margin-top: 25px;
    }
}

/* Petits mobiles (max-width: 576px) */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header .lead {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .form-card {
        padding: 15px 10px;
    }

    .form-card h5 {
        font-size: 1rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .form-control,
    .form-select {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    textarea.form-control {
        min-height: 80px;
    }

    .btn-svci {
        padding: 10px 15px;
        font-size: 0.95rem;
    }

    .benefit-card {
        padding: 15px 10px;
    }

    .benefit-icon {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .benefit-title {
        font-size: 1rem;
    }

    .benefit-card p {
        font-size: 0.85rem;
    }

    .temoignage-card {
        padding: 15px 10px;
        overflow: hidden;
        word-wrap: break-word;
    }

    .temoignage-card:before {
        font-size: 2.5rem;
    }

    .temoignage-text {
        font-size: 0.85rem;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .alert {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .alert i {
        font-size: 0.9rem;
    }
}

/* Mode paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .page-header {
        padding: 30px 0;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .form-section,
    .benefits-section,
    .temoignage-section,
    .faq-section {
        padding: 30px 0;
    }
}

/* Améliorations pour l'accessibilité et la lisibilité */
@media (max-width: 768px) {

    /* Améliorer les espaces entre les champs du formulaire */
    .mb-3 {
        margin-bottom: 1rem !important;
    }

    /* Améliorer la visibilité des champs obligatoires */
    .required-field::after {
        font-size: 1.1rem;
        font-weight: bold;
    }

    /* Améliorer les zones de clic pour mobile */
    .form-check-input {
        width: 1.2rem;
        height: 1.2rem;
        margin-top: 0.2rem;
    }

    .form-check-label {
        margin-left: 0.3rem;
        font-size: 0.9rem;
    }

    /* Améliorer l'apparence des boutons sur mobile */
    .btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Améliorer les modals sur mobile */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 8px;
    }
}

/* Support pour les très petits écrans (max-width: 360px) */
@media (max-width: 360px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .form-card {
        padding: 12px 8px;
    }

    .btn-svci {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}

/* Styles simples pour la nationalité et le diocèse */
#nationalite_search,
#diocese_search {
    margin-bottom: 8px;
}

#nationalite,
#diocese {
    height: 200px;
    font-size: 0.95rem;
}

#nationalite optgroup,
#diocese optgroup {
    font-weight: 600;
    color: var(--svci-blue);
    margin-top: 5px;
}

@media (max-width: 768px) {

    #nationalite_search,
    #diocese_search {
        font-size: 16px;
    }

    #nationalite,
    #diocese {
        height: 180px;
        font-size: 14px;
    }
}
