form {
    margin:10px 0px;
}

form.table-filter label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

form[name="article"] {
    & > div {
        margin: 20px 0px;
    }

    .tox.tox-tinymce {
        border-radius: 0px;
        border-color: #F8F8F8;
    }

    .tox-edit-area__iframe{
        background-color: #f0f4ff;
    }

    .form-control,
    [data-collection-entry] .card {
        border: 2px solid #F8F8F8 !important;
        border-radius: 0;
        background-color: #f0f4ff;
    }

    [data-collection-entry] .card {
        margin:10px 0px;
        .form-control {
            background-color: #fff;
        }
    }

    .form-check.form-switch {
        padding: 0;
        label {
            padding: 0;
            margin-right: 100px;
        }
    }

    #article_published {
        height: 24px;
        width: 48px;
    }
}

#article_intro + .tox-tinymce {
  height: 260px !important;
}

#article_content + .tox-tinymce {
  height: 400px !important;
}

.row > i {
    width: inherit !important;
}

.datepicker {
    position: relative; 
}

.datepicker-icon {
    font-size: 1.4rem;
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    position: absolute;
    right: 5px;
    top: calc( 50% - 3px);
    transform: translateY(-50%);
    color: var(--pink);
    pointer-events: none;
}

#purchase_form_purchaseReceiptFile {
    display: none !important;
}

/* ——— Base & conteneur ——— */
.cn-datepicker.flatpickr-calendar {
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  border: 1px solid #e5e7eb;
}

/* Header (mois / navigation) */
.cn-datepicker .flatpickr-months {
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.cn-datepicker .flatpickr-monthDropdown-months {
    font-family: "Open Sans", sans-serif;
    text-transform: uppercase;
    color: var(--pink);
}

.cn-datepicker .flatpickr-months .flatpickr-month {
    font-family: "Open Sans", sans-serif;
    text-transform: uppercase;
    color: var(--pink);
    font-weight: 600;
}
.cn-datepicker .flatpickr-prev-month,
.cn-datepicker .flatpickr-next-month {
  opacity: .7;
}
.cn-datepicker .flatpickr-prev-month:hover,
.cn-datepicker .flatpickr-next-month:hover {
  opacity: 1;
}

/* Jours (grille) */
.cn-datepicker .flatpickr-days {
    /* Styles pour la grille des jours */
}
.cn-datepicker .flatpickr-day {
    /* Styles pour chaque jour */
}

/* Aujourd’hui */
.cn-datepicker .flatpickr-day.today {
  border-color: var(--pink);       /* violet indigo */
  color: #111827;
}

/* Survol */
.cn-datepicker .flatpickr-day:hover {
  background: #eef2ff;         /* indigo-50 */
}

/* Sélection simple */
.cn-datepicker .flatpickr-day.selected,
.cn-datepicker .flatpickr-day.selected:hover {
  background: var(--pink);         /* indigo-600 */
  color: #fff;
  border-color: var(--pink);
}

.cn-datepicker .flatpickr-day.today:hover {
    background: var(--pink);
}

/* Mode "range" (plage de dates) */
.cn-datepicker .flatpickr-day.inRange {
  background: #e0e7ff;         /* indigo-100 */
  color: #111827;
}
.cn-datepicker .flatpickr-day.startRange,
.cn-datepicker .flatpickr-day.endRange {
  background: var(--pink);
  color: #fff;
}

/* Weekdays (en-têtes L M M J V S D) */
.cn-datepicker .flatpickr-weekday {
  color: var(--pink);              /* slate-500 */
  font-weight: 600;
}

/* Jours désactivés */
.cn-datepicker .flatpickr-day.flatpickr-disabled,
.cn-datepicker .flatpickr-day.prevMonthDay,
.cn-datepicker .flatpickr-day.nextMonthDay {
  color: #cbd5e1;              /* slate-300 */
}

/* Focus clavier (accessibilité) */
.cn-datepicker .flatpickr-day:focus {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
}

/* Time picker (si enableTime: true) */
.cn-datepicker .flatpickr-time {
  border-top: 1px solid #eee;
}
.cn-datepicker .flatpickr-time input,
.cn-datepicker .flatpickr-time .flatpickr-time-separator {
  font-size: 14px;
}
.cn-datepicker .flatpickr-time .numInputWrapper:hover {
  background: #f3f4f6;         /* gray-100 */
}

/* ============================================
   FORMULAIRES - Pages d'administration
   ========================================== */

/* Styles spécifiques aux formulaires des pages d'administration */
[data-route^="admin_"] input[type="file"] {
    display: block !important;
}

/* ============================================
   FORMULAIRES - Pages de compte utilisateur
   ========================================== */

[data-route^="account_"] #codepriv::placeholder {
    text-align: center;
    color: #ccc;
}

[data-route^="account_"] #promo_code_use_form_reference {
    margin: 10px 0 14px 0;
}

/* Datepicker styles pour les pages de compte */
[data-route^="account_"] .gj-datepicker-bootstrap [role="right-icon"] button {
    width: 38px;
    position: relative;
    border-right: 1px solid #f2f4f8 !important;
    border-top: 1px solid #f2f4f8 !important;
    border-bottom: 1px solid #f2f4f8 !important;
}

[data-route^="account_"] .gj-datepicker-bootstrap [role="right-icon"] button .gj-icon,
[data-route^="account_"] .gj-datepicker-bootstrap [role="right-icon"] button .material-icons {
    position: absolute;
    font-size: 35px !important;
    top: 1px !important;
    left: 9px;
    color: #ed6c8f;
}

[data-route^="account_"] .fa-calendar {
    font-size: 1.6rem !important;
    margin-top: -8px;
    color: #ed6c80;
}

/* ============================================
   FORMULAIRES - Pages de connexion/inscription
   ========================================== */

[data-route*="login"] input#user_form_isNewsletter,
[data-route*="registration"] input#user_form_isNewsletter {
    margin: 0 16px 0 16px;
}

[data-route*="login"] input#user_form_isCgu,
[data-route*="login"] input#user_form_isTos,
[data-route*="registration"] input#user_form_isCgu,
[data-route*="registration"] input#user_form_isTos {
    margin: 5px 5px 5px 10px;
}

[data-route*="login"] .row-cgv {
    height: 20px;
}

[data-route*="login"] #login input {
    margin-top: 0px !important;
    margin-bottom: 6px;
    height: 26px !important;
    padding-top: 3px;
}

/* ============================================
   FORMULAIRES - Styles globaux
   ========================================== */

.form-control {
    border-radius: 0px;
    font-size: 0.9rem;
}

#exampleInputPassword1 {
    margin-bottom: 2px;
}

/* ============================================
   FORMULAIRES - Pages de preuves d'achat/purchase
   ========================================== */

[data-route*="purchase"] #achat label,
[data-route*="purchase"] #contact label {
    color: #719dc6 !important;
    font-size: 0.8rem;
}

[data-route*="purchase"] #connexion label,
[data-route*="purchase"] #login label,
[data-route*="purchase"] #cart label {
    color: #719dc6;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

[data-route*="purchase"] #parrainage label {
    font-size: 0.9rem;
}

[data-route*="purchase"] #purchase-form input {
    border: none;
}

[data-route*="purchase"] #achat input[type="text"],
[data-route*="purchase"] #achat input[type="number"],
[data-route*="purchase"] #achat select {
    margin-top: 0px !important;
    margin-bottom: 6px;
    height: 26px !important;
    padding-top: 2px;
    color: #004587;
}

[data-route*="purchase"] .datepicker {
    display: block;
}

[data-route*="purchase"] .datepicker-product {
    border-radius: 0px;
}

[data-route*="purchase"] #purchase_form_placeName {
    height: 30px;
    padding-right: 0;
}

[data-route*="purchase"] #purchase_form_pharmacy {
    width: 70%;
}

[data-route*="purchase"] .dataTables_filter input {
    border: 1px solid #c6c6c6 !important;
    border-radius: 5px !important;
    margin-bottom: 10px !important;
}

[data-route*="purchase"] #achat .file-label label {
    padding: 6px 40px;
    background-color: #004587;
    color: #fff !important;
    cursor: pointer;
}

[data-route*="purchase"] .file-label label {
    color: white !important;
    float: right;
}

/* ============================================
   FORMULAIRES - Pages d'inscription
   ========================================== */

[data-route*="registration"] #inscription label {
    margin-bottom: 0 !important;
    margin-right: 0.35rem;
    color: #719DC6 !important;
    font-size: 0.9rem;
    margin-bottom: 0px;
}

[data-route*="registration"] #user_form_password label {
    color: #004587 !important;
}

[data-route*="registration"] .form-control {
    border: 1px solid white !important;
}

[data-route*="registration"] #inscription input[type="text"],
[data-route*="registration"] #inscription input[type="password"] {
    margin-top: 0px !important;
    margin-bottom: 6px;
    height: 26px !important;
    padding-top: 3px;
}

[data-route*="registration"] #user_form_birthDate {
    border-radius: 0;
}

[data-route*="registration"] .input-group-append {
    margin-top: -6px;
}

/* Checkboxes et radio buttons */
[data-route*="registration"] #user_form_childGender_0,
[data-route*="registration"] #user_form_childGender_1 {
    height: 15px !important;
}

[data-route*="registration"] #user_form_gender_0 {
    height: 17px !important;
}

[data-route*="registration"] #user_form_gender_1 {
    height: 15px !important;
}

[data-route*="registration"] #user_form_parent2Gender_0,
[data-route*="registration"] #user_form_parent2Gender_1 {
    height: 17px !important;
}

[data-route*="registration"] #user_form_isCgu,
[data-route*="registration"] #user_form_isTos {
    height: 15px !important;
}

[data-route*="registration"] .gender-checkbox input {
    height: 17px !important;
}

/* Datepicker */
[data-route*="registration"] .ui-datepicker-trigger {
    margin-top: -30px;
    margin-left: 88%;
}

/* ============================================
   FORMULAIRES - Pages d'administration spécifiques
   ========================================== */

[data-route^="admin_"] .form-points {
    background: #eee;
}

/* ============================================
   UPLOAD D'IMAGES - Zone d'upload personnalisée
   ========================================== */

.image-upload-container {
    margin: 20px 0;
}

.form-label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background-color: #fafafa;
    transition: all 0.3s ease;
    position: relative;
}

.upload-zone:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-hint p {
    font-size: 16px;
    color: #6c757d;
    margin: 10px 0;
}

.upload-hint small {
    color: #adb5bd;
}

.current-image {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
}

.preview-image {
    max-width: 300px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.current-filename {
    margin-top: 10px;
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

.image-preview {
    display: none;
    margin-top: 20px;
    text-align: center;
}

.image-preview img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 3px solid #28a745;
}

.image-preview .filename {
    margin-top: 10px;
    font-size: 14px;
    color: #28a745;
    font-weight: 500;
}

/* ============================================
   SWITCH PERSONNALISÉ - Toggle moderne
   ========================================== */

.custom-switch-container {
    width: 60px;
    height: 34px;
    background-color: #ccc;
    border-radius: 34px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-left: 10px;
}

.custom-switch-container:hover {
    background-color: #bbb;
}

.custom-switch-container.active {
    background-color: #28a745;
}

.custom-switch-container.active:hover {
    background-color: #218838;
}

.custom-switch-thumb {
    height: 26px;
    width: 26px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 4px;
    left: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.custom-switch-container.active .custom-switch-thumb {
    transform: translateX(26px);
}

.switch-active {
    color: #28a745;
    font-weight: 600;
}

.switch-inactive {
    color: #6c757d;
}

.form-check.form-switch {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.form-check.form-switch label {
    margin-bottom: 0;
    margin-right: 15px;
}

/* ============================================
   ACTIONS DE FORMULAIRE - En-tête et pied de page
   ========================================== */

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.header-actions h1 {
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.footer-actions {
    margin: 40px 0 30px 0;
    text-align: center;
    padding: 20px;
    border-top: 2px solid #f8f9fa;
    background-color: #fafafa;
    border-radius: 8px;
}

.footer-actions .sliderbtn {
    margin: 0 10px;
    display: inline-block;
}

/* ============================================
   BOUTON RETOUR EN HAUT - Scroll to top
   ========================================== */

.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--pink);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background-color: color-mix(in srgb, var(--pink), black 20%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-top-btn:active {
    transform: translateY(-1px);
}
