/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    backface-visibility: hidden; 
}

body {
    font-family: 'Roboto', sans-serif;
    color: #545454!important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== FORM COMPONENTS ===== */
.form-details {
    display: none; 
    gap: 20px;
    flex-wrap: wrap;
    will-change: opacity, max-height, transform;
    transform: translateZ(0); 
}

.form-wrapper {
    width: 1400px;   
    margin: -15px auto;
    padding: 15px;
    background-color: #19559E;
    font-family: 'Roboto', sans-serif;
    border-radius: 10px;
}

.form-group {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin: 4px 0;
    
}

#form-wrapper-mini{
    width: 570px;
    margin-bottom: 60px;
}

.form-title-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.form-title {
    color: #fff;
}

.form-content {
    width: 100%;
    font-family: 'Roboto', sans-serif;
}

/* ===== SELECT STYLES ===== */
select.form-content {
    color: #004399;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    padding: 17px 48px 17px 12px;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23004399" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 25px center;
    background-size: 24px;
}

/* ===== INPUT STYLES ===== */
.input-immatriculation {
    display: flex;
    justify-content: flex-start;
    border: 3px solid #fff;
    height: 100%;
}

.inputImmatriculation {
    width: 85%;
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    border: none;
    padding: 17px 10px;
    text-align: center;
    text-transform: uppercase;
}

.inputImmatriculation::placeholder {
    text-align: center;
    font-weight: bold;
    color: #B9B9B9;
}
.inputImmatriculation::-webkit-input-placeholder { text-align: center; }
.inputImmatriculation::-moz-placeholder { text-align: center; }
.inputImmatriculation:-ms-input-placeholder { text-align: center; }

/* ===== LABEL STYLES ===== */
label[for="immatriculation"] {
    color: #fff;
    text-align: left;
    font-weight: bold;
    font-size: 16px;
}

.width-mid {
    font-family: 'Roboto', sans-serif;
    width: 100%;
    font-size: 20px;
    font-weight: 600;
}

.label-immatriculation.width-mid {
    width: 50%;
}

.label-absolute {
    position: absolute;
    top: -45%;
    text-align: center;
    font-size: 16px;
}

.form-group .label-immatriculation {
    display: none;
}

/* ===== BUTTON STYLES ===== */
button[type="submit"] {
    background-color: #FFA323;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    font-size: 20px;
}

.desktop-btn { display: block; }
.mobile-btn { display: none; }

/* ===== FORM DETAILS ===== */
.row-container {
    width: 30%;
}

.label-wrapper {
    display: flex;
    justify-content: space-between;
}

.detail-label {
    width: 50%;
    padding: 10px 0;
    color: #fff;
    font-weight: 600;
}

.form-title.width-mid.detail-label,
label.form-title.width-mid.detail-label {
    font-size: 15px;
}

.indication {
    width: 50%;
    display: flex;
    justify-content: flex-end;
    color: #fff;
    align-items: center;
    font-size: 12px;
}

.form-details input[type="text"],
.form-details input[type="time"],
.form-details input[type="date"] {
    width: 100%;
    padding: 17px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
    height: 53px;
    box-sizing: border-box;
    text-align: center;
    color: #004399;
}

.form-details input[type="text"]:focus,
.form-details input[type="time"],
.form-details input[type="date"]:focus {
    border-color: #004399;
    box-shadow: 0 0 0 2px rgba(0, 67, 153, 0.2);
}

.form-details select.form-content {
    height: 53px;
    box-sizing: border-box;
    padding: 14px 48px 17px 12px;
}

/* Radio button styling */
.radio-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}
.radio-group {
    display: flex;
    gap: 45px;
}
.form-details input[type="radio"] { display: none; }

.form-details label[for="occasion_fr"],
.form-details label[for="occasion_importee"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background-color: #fff;
    color: #004399;
    border: 2px solid #004399;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 150px;
    height: 53px;
}

.form-details input[type="radio"]:checked + label {
    background-color: #004399;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 67, 153, 0.3);
}

.form-details label[for="occasion_fr"]:hover,
.form-details label[for="occasion_importee"]:hover {
    background-color: #0056b3;
    color: #fff;
}

/* Checkbox block */
#bloc_adr4 .checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    height: 53px;
    color: #004399;
    font-weight: 600;
    margin-bottom: 10px;
}
#bloc_adr4 input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #004399;
}
label.form-title.width-mid.detail-label[for="adr4"] {
    width: 100%;
}

/* ===== TOGGLE ===== */
.toggle-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #fff;
}
.toggle-container input[type="checkbox"] { display: none; }
.toggle-switch {
  width: 50px;
  height: 26px;
  background-color: #ccc;
  border-radius: 26px;
  position: relative;
  transition: background-color 0.3s;
}
.toggle-switch::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}
.toggle-container input[type="checkbox"]:checked + .toggle-switch {
  background-color: #28a745;
}
.toggle-container input[type="checkbox"]:checked + .toggle-switch::before {
  transform: translateX(24px);
}

/* ===== ETOILE ===== */
.etoile-wrapper, .empty-div { width: 12%; }
.etoile-wrapper { display: flex; justify-content: center; align-items: center; }
.etoile { color: red; }

/* ===== LOADER ===== */
#loader {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  color: #004399;
  gap: 15px;
}
#loader .spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #004399;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.img_cout_carte_grise {
    display: none !important;
}

/* ===== MEDIA QUERIES ===== */
.label-immatriculation.width-mid { display: none; }
.label-immatriculation.width-mid .labelImmatriculation { font-size: 11px; }

@media (max-width: 768px) {
    .form-details { flex-direction: column; }
    .row-container { width: 100%; }
    label.form-title.width-mid.detail-label { font-size: 13px; }
    .mobile-btn { display: block; }
    .desktop-btn { display: none; }
    .class-imma { text-align: center; font-size: 13px; display: block; padding-bottom: 10px; }
    .form-group { flex-direction: column; }
    .form-group .label-immatriculation { display: flex; justify-content: center; }
    .inputImmatriculation { width: 76%; }
    .label-absolute { display: none; }
    .radio-group { gap: 35px; flex-direction: row; }
    .form-details label[for="occasion_fr"],
    .form-details label[for="occasion_importee"] { margin: 5px 0 10px 0; min-width: unset; }
    .form-wrapper {border-radius: 0px; width: auto; };
}


/* ===== STICKY MODE ===== */
#calculateur_header.fixed .form-wrapper {
    padding: 15px 15px;
    border-radius: 0;
    margin-top: 0px;
}

/* Mobile sticky (encore plus compact) */
@media (max-width: 767px) {
    #calculateur_header.fixed .form-wrapper {
        padding: 8px 10px;
        border-radius: 0;
    }
    #calculateur_header.fixed .form-group {
        flex-direction: column;
        gap: 8px;
    }
    #calculateur_header.fixed select.form-content,
    #calculateur_header.fixed .inputImmatriculation {
        font-size: 13px;
        padding: 8px;
        height: 46px;
    }
    #calculateur_header.fixed button[type="submit"] {
        font-size: 14px;
        height: 36px;
    }
}

/* ===== STICKY MOBILE TRANSPARENT ===== */
@media (max-width: 767px) {
    #calculateur_header.fixed .form-wrapper {
    background-color: rgba(4, 108, 244, 0.7);
        backdrop-filter: none; 
        -webkit-backdrop-filter: none;
    }
}


/* Bouton fermer sticky */
.close-sticky {
    display: none; 
    position: absolute;
    top: 1px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

@media (max-width: 767px) {
    #calculateur_header.fixed .close-sticky {
        display: block;
    }
}


/* === Mini calculateur : forcer le layout mobile partout === */
#mini-calculateur .form-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

#mini-calculateur select,
#mini-calculateur input,
#mini-calculateur button {
    width: 100% !important;
    max-width: 100%;
}

/* Mini calculateur : bouton unique selon viewport */
#mini-calculateur .desktop-btn {
    width: 100% !important;
}

@media (max-width: 768px) {
  #mini-calculateur .desktop-btn { display: none !important; }
  #mini-calculateur .mobile-btn { display: block !important; }
}

