
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;

    /* Animation */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    padding: 25px 30px;
    border-radius: 12px;
    max-width: 95%;
    width: 600px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-height: 90vh;
    /* overflow-y: auto; */
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.2rem;
    font-weight: 300;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
}

/* --- Gallery Styles (Modal Images) --- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.gallery img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

/* --- Form Styles (Modals Reception & Probleme) --- */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label, .form-group-checkbox label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.btn-submit {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color, rgb(169, 5, 5));
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    align-self: flex-end; /* Aligns button to the right */
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: var(--sombre-primary-color, rgb(121, 3, 3));
}

/* --- Champs dates éditables pour l'admin --- */
.admin-field-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.admin-field-group label {
    min-width: 150px;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.admin-date-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
}

.admin-date-input:focus {
    outline: none;
    border-color: var(--primary-color, rgb(169, 5, 5));
}

.admin-save-btn {
    width: 100%;
    margin-top: 12px;
    align-self: stretch;
}

/* --- Champs texte éditables pour l'admin (Ref Conteneur, Ref Booking) --- */
.admin-text-group {
    align-items: center;
}

.field-display-value {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

.admin-text-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
}

.admin-text-input:focus {
    outline: none;
    border-color: var(--primary-color, rgb(169, 5, 5));
}

.edit-icon-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 7px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.edit-icon-btn:hover {
    background-color: #f0f0f0;
    color: var(--primary-color, rgb(169, 5, 5));
    border-color: var(--primary-color, rgb(169, 5, 5));
}

.edit-icon-btn.save-mode {
    color: green;
    border-color: green;
}

.edit-icon-btn.save-mode:hover {
    background-color: #e8f5e9;
    color: green;
    border-color: green;
}

/* ===== Modale devis global — largeur élargie ===== */
.devis-global-modal-content {
    width: 700px;
    overflow-y: auto;
}

/* ===== Sous-formulaire Transport ===== */
.transport-subform {
    display: none;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 4px 0 12px;
    animation: subformSlide 0.3s ease;
}

.transport-subform.visible {
    display: block;
}

@keyframes subformSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.subform-title {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px;
}

.subform-desc {
    font-size: 0.82rem;
    color: #777;
    margin: 0 0 14px;
    line-height: 1.4;
}

.transport-subform .form-group {
    margin-bottom: 10px;
}

.transport-subform .form-group label {
    font-size: 0.78rem;
    color: #888;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.transport-subform select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inria Sans', sans-serif;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: auto;
}

.transport-subform select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Ligne 1 : départ | swap | destination  —  Ligne 2 : date */
.subform-locations {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: end;
    margin-top: 4px;
}

.subform-locations .form-group:last-child {
    grid-column: 1 / -1;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper .subform-icon {
    position: absolute;
    left: 11px;
    color: #aaa;
    font-size: 0.85rem;
    pointer-events: none;
}

.input-icon-wrapper input {
    width: 100%;
    padding: 10px 10px 10px 32px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inria Sans', sans-serif;
    background: #fff;
    transition: border-color 0.2s;
}

.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.swap-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background-color 0.2s, transform 0.3s;
    margin-bottom: 2px;
}

.swap-btn:hover {
    background-color: var(--sombre-primary-color);
    transform: rotate(180deg);
}

/* Responsive sous-formulaire */
@media (max-width: 420px) {
    .subform-locations {
        grid-template-columns: 1fr;
    }
    .swap-btn {
        justify-self: center;
    }
}

.modal-auth-required{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: black;
}

.modal-auth-required .btn-submit{
    align-self: center;
}

