:root {
    --form-bg: #ffffff;
    --form-border: #d6d8db;
    --form-accent: #2563eb; /* bleu */
    --form-error: #dc2626; /* rouge */
    --form-muted: #6b7280; /* gris */
    --form-radius: 8px;
    --form-padding: 0.75rem;
    --transition-fast: 0.18s ease;
}

/* ================= Formulaire ================= */
form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 25px;
    margin: 10px auto;
    width: 100%;
    max-width: 500px;
}
form input:hover {
    border: 3px solid var(--primary-color);
    box-shadow: var(--box-shadow);
}
form input:focus {
    background-color: #ecffa0;
}
form.submit-btn-form {
    display: flex;
    justify-content: center;
    margin: 5px auto;
    width: fit-content;
    padding: 0;
    align-items: center;
}
form .btn {
    margin: 10px auto;
}

/* ================= Form rows & floating ================= */
.form-row,
.form-floating {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
    width: 100%;
    position: relative;
}

/* Labels classiques */
.form-row > label,
.form-label,
form label {
    display: block;
    font-size: 0.7rem;
    color: var(--form-muted);
    margin-bottom: 0.5rem; /* plus d’espace */
    color: var(--label-text-color);
}

/* Labels horizontaux */
.row-horizontal {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.5rem 1rem; /* vertical | horizontal */
    align-items: center;
    width: 100%;
}

/* ================= Inputs / textarea / select ================= */
input,
select,
textarea,
button {
    font-family: inherit;
}

/* ========================
   Styles généraux pour tous les champs
   ======================== */
.form-control,
input:not([type="checkbox"]),
input:not([type="radio"]),
textarea,
select {
    appearance: none;
    background: var(--form-bg);
    border: 1px solid var(--primary-color);
    border-radius: var(--form-radius);
    padding: var(--form-padding);
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color var(--transition-fast),
        box-shadow var(--transition-fast), transform var(--transition-fast);
    box-sizing: border-box;
    align-self: stretch;
    margin-bottom: 10px;
    width: 100%;
}
#user_form_roles {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: center;
    gap: 10px;
}
/* ========================
   Styles spécifiques par type
   ======================== */

input[type="email"],
.form-control[type="email"] {
    border-color: #007bff;
}

input[type="password"],
.form-control[type="password"] {
    font-family: monospace;
}

/* ========================
   Cases à cocher
   ======================== */
input[type="checkbox"] {
    width: auto; /* largeur normale */
    margin: 0 0.5em 0 0; /* espacement à droite */
    vertical-align: middle; /* alignement avec label */
    accent-color: var(--form-border);
    appearance: auto;
}

input[type="checkbox"] + label {
    font-size: 1rem;
    line-height: 1.4;
    cursor: pointer;
}
.euro-field {
    padding-right: 2em;
    position: relative;
}

.euro-field::after {
    content: "€";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
}

/* ========================
   Optionnel : focus & hover
   ======================== */
input:focus,
textarea:focus,
select:focus {
    border-color: var(--form-focus-border);
    box-shadow: 0 0 0 3px var(--form-focus-shadow);
    outline: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--form-accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.form-control[disabled],
.form-control[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Help text / erreurs */
.form-help,
.form-text {
    font-size: 0.8125rem;
    color: var(--form-muted);
}

.form-errors,
.form-error {
    color: var(--form-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* Required marker */
.form-row > label.required::after,
.form-label.required::after {
    content: " *";
    color: var(--form-error);
    margin-left: 0.125rem;
    font-weight: 700;
}

/* ================= Floating labels ================= */
.form-floating {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-floating .form-control {
    padding: 1.5rem 0.75rem 0.5rem 0.75rem; /* plus d’espace pour label */
}

.form-floating label {
    position: absolute;
    left: 0.75rem;
    top: 1.25rem; /* décale label initiale */
    transform-origin: left top;
    font-size: 1rem;
    color: var(--form-muted);
    pointer-events: none;
    transition: transform var(--transition-fast), top var(--transition-fast),
        font-size var(--transition-fast), color var(--transition-fast);
    background: transparent;
    padding: 0 0.125rem;
}

/* Floating label au focus ou quand champ rempli */
.form-floating .form-control:focus + label,
.form-floating .form-control:not(:placeholder-shown) + label,
.form-floating .form-control.has-value + label {
    top: 0.375rem;
    transform: scale(0.82);
    font-size: 0.78rem;
    color: var(--form-accent);
}

/* ================= Inline / fieldset ================= */
.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.fieldset {
    border: 1px solid var(--form-border);
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* Accessibility helpers */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.agree-terms {
    display: flex;
    align-items: center;
    margin: 10px;
}

.agree-terms label {
    margin-left: 0.5rem;
    margin-bottom: 0;
}
/*================== wrapper contrôle mot de passe ====*/
.password-strength ul {
    list-style: none;
    margin: 10px;
}

.deja-inscrit {
    font-size: 16px;
    color: darkblue;
}
.deja-inscrit a {
    text-decoration: underline;
}

/* ================= Search form ================= */
.search-form {
    display: flex;
    width: 100%;
    margin-top: 0;
    padding: 5px;
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 600px;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccc;
    height: 45px;
}

.search-container .search-input {
    flex: 1;
    padding: 0 15px;
    border: none;
    font-size: 16px;
    outline: none;
    height: 100%;
    box-sizing: border-box;
}

.search-container .search-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    font-size: 18px;
    height: 100%;
}

.search-container .search-button:hover {
    background: #0056b3;
}

#form-2fa .qrCode-2fa-verify {
    width: 200px;
    height: 200px;
}
#form-2fa .totp_code {
    font-weight: bold;
    width: 200px;
    margin: 10px auto;
}
/* Formulaire de paiement */
.container-payment {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 10px;
    background: #f8f8f8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.payment-methods {
    margin-top: 10px;
    margin-bottom: 25px;
}
h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.text-center {
    text-align: center;
}

/* --- Aligne input + label côte à côte pour les ChoiceType expanded --- */
.payment-methods .choices > div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.payment-methods .choices input[type="radio"],
.payment-methods .choices input[type="checkbox"] {
    margin: 0;
}

.payment-methods .choices label {
    margin: 0;
    cursor: pointer;
}

.card-info {
    display: none;
    padding: 1rem;
    margin: 1.5rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
}

button,
input[type="submit"] {
    background-color: #0078d7;
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover,
input[type="submit"]:hover {
    background-color: #005fa3;
}

/* Flash messages */
.flash {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.flash.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.flash.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#offres_form_nbr_adultes,
#offres_form_nbr_enfants {
    text-align: center;
}
.timestamp {
    border: inherit !important;
    outline: none;
    text-align: right;
    color: darkgray;
}
.isLocked,
.isPublished {
    margin-bottom: 20px;
}
.isLocked div,
.isPublished div {
    display: inline-flex;
    flex-direction: row;
    justify-content: space-around;
}
/* Form layout */
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.mt-3 {
    margin-top: 1rem;
}
.mb-3 {
    margin-bottom: 1rem;
}
.text-center {
    text-align: center;
}

/* Error styles */
.error-label {
    color: red;
    font-weight: bold;
}
.error-field {
    border: 1px solid red;
}

/* Buttons */
.btn-back {
    text-decoration: none;
    padding: 5px 10px;
    background-color: #ccc;
    border-radius: 4px;
}
.btn-submit {
    padding: 8px 15px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-submit:hover {
    background-color: #45a049;
}
/* ================= Custom Checkbox ================= */
input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--form-border);
    border-radius: 50%; /* rend la case ronde */
    background-color: #fff;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

input[type="checkbox"]:checked {
    background-color: var(--form-accent);
    border-color: var(--form-accent);
}

input[type="checkbox"]:checked::after {
    content: "✔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: white;
    font-weight: bold;
    pointer-events: none;
}

/* ================= Custom Radio ================= */
input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--form-border);
    border-radius: 50%;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

input[type="radio"]:checked {
    border-color: var(--form-accent);
    background-color: var(--form-accent);
}

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ================= Responsive ================= */
@media (max-width: 480px) {
    .search-container {
        max-width: 100%;
        height: 40px;
    }
    .search-container .search-input {
        font-size: 14px;
    }
    .search-container .search-button {
        font-size: 16px;
        padding: 0 15px;
    }
}

/* ================= Utilities ================= */
.mb-0 {
    margin-bottom: 0 !important;
}
.mb-1 {
    margin-bottom: 0.25rem !important;
}
.mt-1 {
    margin-top: 0.25rem !important;
}

/* Conteneur de chaque champ */
.form-field {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

/* Label du champ */
.form-field label {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

/* Champ input / textarea / select */
.form-field input,
.form-field textarea,
.form-field select {
    border: 1px solid #ccc;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Focus sur le champ */
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Champ invalide */
.form-field input:invalid,
.form-field textarea:invalid,
.form-field select:invalid {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

/* Liste des erreurs */
ul.form-error {
    color: #c0392b;
    margin: 0.25rem 0 0 0;
    padding-left: 1.2rem;
    font-size: 0.875rem;
}

/* Chaque erreur individuelle */
ul.form-error li {
    list-style-type: disc;
    margin-left: 0;
}

/* Optionnel : style du bouton submit */
button[type="submit"] {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: #2980b9;
}
