/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f5f5;
    color: #333;
}

/* Desktop: fond transparent pour intégration dans la page */
@media (min-width: 768px) {
    body {
        background: transparent;
    }
}

/* Container */
#app {
    min-height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
}

/* Main Card - Style LuxRide */
.booking-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 600px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Desktop: Style LuxRide premium */
@media (min-width: 768px) {
    .booking-container {
        max-width: 500px;
        background: rgba(255, 255, 255, 0.98);
        border-radius: 11px;
        box-shadow: 0px 0px 44px 18px rgba(0, 0, 0, 0.06);
        backdrop-filter: blur(10px);
    }
}

/* S'assurer que tous les éléments utilisent border-box */
* {
    box-sizing: border-box;
}

/* Header - masqué complètement pour un layout compact */
.header {
    display: none;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
}

/* Desktop: Déplacer le switcher de langue au-dessus du formulaire */
@media (min-width: 768px) {
    .language-switcher {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 1000;
    }
}

.language-switcher button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.language-switcher button.active {
    background: white;
    color: #000;
}

.language-switcher button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.3);
}

/* Progress Bar - masquée complètement pour un layout compact */
.progress-bar {
    display: none;
}

.progress-step {
    flex: 1;
    display: flex;
    align-items: center;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.step-circle.active {
    background: #000;
    color: white;
}

.step-circle.completed {
    background: #10b981;
    color: white;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 0 8px;
}

.step-line.completed {
    background: #10b981;
}

/* Form Content */
.form-content {
    padding: 20px;
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #000;
}

/* Date Time Grid */
.date-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* Trip Type Grid */
.trip-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.trip-type-grid .radio-option {
    cursor: pointer;
}

/* Form Groups */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

/* Labels avec checkbox : aligner à gauche */
.form-group label[style*="flex"] {
    justify-content: flex-start !important;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #E95440;
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: #000;
    background: #fafafa;
}

.radio-option.selected,
.checkbox-option.selected {
    border-color: #000;
    background: #f5f5f5;
}

/* Desktop: Style LuxRide pour les options */
@media (min-width: 768px) {
    .radio-option,
    .checkbox-option {
        padding: 12px 14px;
        border: 1px solid #e8e8e8;
        border-radius: 6px;
        background: #fafafa;
    }

    .radio-option:hover,
    .checkbox-option:hover {
        border-color: #E95440;
        background: white;
    }

    .radio-option.selected,
    .checkbox-option.selected {
        border-color: #E95440;
        background: #fff5f4;
    }
}

.radio-option input,
.checkbox-option input {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-content {
    flex: 1;
}

.option-content strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.option-content span {
    font-size: 13px;
    color: #666;
}

/* Vehicle Cards */
.vehicle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.vehicle-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.vehicle-card:hover {
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vehicle-card.selected {
    border-color: #000;
    background: #f5f5f5;
}

/* Desktop: Véhicules style LuxRide */
@media (min-width: 768px) {
    .vehicle-card {
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        padding: 16px;
        background: #fafafa;
    }

    .vehicle-card:hover {
        border-color: #E95440;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(233, 84, 64, 0.15);
        background: white;
    }

    .vehicle-card.selected {
        border-color: #E95440;
        background: #fff5f4;
        box-shadow: 0 4px 15px rgba(233, 84, 64, 0.2);
    }
}

.vehicle-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.vehicle-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.vehicle-card p {
    font-size: 13px;
    color: #666;
}

/* Price Card (temps réel) */
.price-card {
    background: linear-gradient(135deg, #E95440 0%, #d64836 100%);
    color: white;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 14px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(233, 84, 64, 0.2);
}

.price-details {
    flex: 1;
}

.price-details div {
    margin-bottom: 4px;
    font-size: 14px;
}

.price-amount {
    font-size: 28px;
    font-weight: 700;
    white-space: nowrap;
}

/* Summary */
.summary-section {
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #000;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    font-weight: 600;
}

.price-total {
    background: #000;
    color: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.price-total h2 {
    font-size: 36px;
    font-weight: 700;
}

.price-total p {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: #E95440;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-primary:hover:not(:disabled) {
    background: #d64836;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233, 84, 64, 0.3);
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.btn-secondary:hover {
    background: #ebebeb;
    border-color: #d0d0d0;
}

/* Masquer les messages d'erreur Google Maps */
.gm-err-container,
.gm-err-content,
.gm-err-message {
    display: none !important;
}

/* Google Maps Autocomplete */
.pac-container {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    font-family: inherit;
    z-index: 10000 !important;
}

.pac-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    line-height: 1.4;
}

.pac-item:hover {
    background: #f5f5f5;
}

.pac-item-selected {
    background: #f0f0f0;
}

.pac-icon {
    display: none;
}

.pac-item-query {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.pac-matched {
    font-weight: 700;
}

/* Location Button */
.location-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.3s;
}

.location-btn:hover {
    background: #e0e0e0;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 40px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.success-message h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #10b981;
}

.success-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.booking-reference {
    background: #f0fdf4;
    border: 2px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
}

/* Error Message */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Options incluses texte */
.options-included {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 16px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Desktop Layout Optimisations */
@media (min-width: 768px) {
    /* Header plus compact sur desktop */
    .header {
        padding: 24px 40px;
    }

    .header h1 {
        font-size: 26px;
    }

    /* Adresses en 2 colonnes sur desktop */
    .addresses-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    /* Coordonnées - 3 champs: nom pleine largeur, email et tel en 2 colonnes */
    .contact-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }

    .contact-grid .form-group:first-child {
        grid-column: 1 / -1;
    }

    /* Formulaire complet responsive */
    .form-content {
        padding: 40px;
    }

    /* Prix plus compact */
    .price-card {
        padding: 24px;
        margin: 20px 0;
    }

    /* Résumé en 2 colonnes si beaucoup d'infos */
    .summary-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    /* Progress bar plus compact */
    .progress-bar {
        padding: 20px 40px;
    }

    /* Boutons en ligne sur desktop */
    .button-group {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        gap: 12px;
    }

    .button-group button {
        flex: 0 1 auto;
        min-width: 160px;
    }
}

/* Très grand écran (1200px+) */
@media (min-width: 1200px) {
    .booking-container {
        max-width: 1000px;
    }
}

/* Responsive Mobile */
@media (max-width: 640px) {
    /* Empêcher tout débordement horizontal */
    body {
        overflow-x: hidden;
    }

    /* Forcer les grilles desktop à revenir en mode colonne sur mobile */
    .addresses-grid,
    .contact-grid,
    .summary-grid {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    .addresses-grid .form-group,
    .contact-grid .form-group {
        margin-bottom: 16px;
    }

    /* Container mobile - supprimer padding pour maximiser l'espace */
    #app {
        padding: 0;
        align-items: flex-start;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .booking-container {
        border-radius: 0;
        min-height: 100vh;
        max-width: 100%;
        width: 100%;
        box-shadow: none;
        overflow-x: hidden;
    }

    /* Header */
    .header {
        padding: 16px 16px 12px;
    }

    .header h1 {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .header p {
        font-size: 12px;
    }

    .language-switcher {
        top: 16px;
        right: 16px;
    }

    .language-switcher button {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Progress bar */
    .progress-bar {
        padding: 10px 16px;
        overflow-x: auto;
    }

    .step-circle {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .step-line {
        min-width: 16px;
    }

    /* Contenu formulaire */
    .form-content {
        padding: 16px 16px;
    }

    .step-title {
        font-size: 18px;
        margin-bottom: 14px;
    }

    /* Champs de formulaire */
    .form-group {
        margin-bottom: 12px;
        width: 100%;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 4px;
        display: block;
        width: 100%;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px; /* Important : 16px évite le zoom sur iOS */
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
        border: 2px solid #e0e0e0;
    }

    /* Google Maps Autocomplete inputs */
    input[type="text"],
    input[type="date"],
    input[type="time"],
    input[type="tel"],
    input[type="email"],
    input[type="number"] {
        width: 100% !important;
        max-width: 100%;
    }

    /* Date et heure - passer en colonne sur mobile */
    .date-time-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .date-time-grid .form-group {
        margin-bottom: 0;
    }

    /* Type de trajet - garder 2 colonnes sur mobile mais optimiser */
    .trip-type-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Radio options */
    .radio-option,
    .checkbox-option {
        padding: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .option-content {
        width: 100%;
        overflow: hidden;
    }

    .option-content strong {
        font-size: 15px;
        display: block;
        word-wrap: break-word;
    }

    .option-content span {
        font-size: 12px;
        display: block;
        word-wrap: break-word;
    }

    /* Grid de type de trajet sur mobile */
    div[style*="grid-template-columns: 1fr 1fr"] .radio-option {
        width: 100%;
    }

    /* Véhicules - 1 colonne sur mobile */
    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .vehicle-card {
        padding: 16px;
    }

    .vehicle-icon {
        font-size: 40px;
    }

    .vehicle-card h3 {
        font-size: 16px;
    }

    .vehicle-card p {
        font-size: 12px;
    }

    /* Price card mobile */
    .price-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 16px 0;
    }

    .price-details {
        margin-bottom: 12px;
    }

    .price-details div {
        font-size: 13px;
    }

    .price-amount {
        font-size: 32px;
        align-self: flex-end;
    }

    /* Résumé */
    .summary-section {
        padding: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 16px 0;
    }

    .summary-section h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .summary-item {
        padding: 10px 0;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .summary-item span,
    .summary-item strong {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Prix total */
    .price-total {
        padding: 16px;
    }

    .price-total h2 {
        font-size: 28px;
    }

    .price-total p {
        font-size: 13px;
    }

    /* Boutons mobile */
    .button-group {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 20px;
        width: 100%;
        align-items: stretch;
    }

    button {
        padding: 14px 20px;
        font-size: 15px;
        width: 100% !important;
        text-align: center;
    }

    .location-btn {
        padding: 10px 14px;
        font-size: 13px;
        margin-top: 10px;
    }

    /* Autocomplete suggestions mobile */
    .pac-container {
        max-width: calc(100vw - 32px);
        margin-left: 16px;
        margin-right: 16px;
    }

    .pac-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Messages */
    .error-message {
        padding: 10px 14px;
        font-size: 13px;
        margin-bottom: 12px;
    }

    .success-message {
        padding: 24px 16px;
    }

    .success-icon {
        font-size: 48px;
    }

    .success-message h2 {
        font-size: 20px;
    }

    .success-message p {
        font-size: 14px;
    }

    .booking-reference {
        padding: 12px;
        font-size: 16px;
    }

    /* Règles générales pour éviter tout débordement */
    .form-content > *,
    .form-group > * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* S'assurer que tous les divs respectent la largeur */
    div {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Google autocomplete container */
    .pac-container {
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
    }
}

/* Hide elements */
.hidden {
    display: none;
}
