/* ==========================================================================
   Taxi Booking - Frontend CSS (mobile-first)
   ========================================================================== */

.tb-form {
    --tb-primary: #f0c040;
    --tb-primary-dark: #d4a932;
    --tb-text: #1a1a1a;
    --tb-text-light: #666;
    --tb-border: #e5e5e5;
    --tb-bg: #fff;
    --tb-bg-alt: #f7f7f7;
    --tb-radius: 10px;
    --tb-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);

    max-width: 760px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--tb-text);
    background: var(--tb-bg);
    border-radius: var(--tb-radius);
    padding: 20px;
    box-shadow: var(--tb-shadow);
    box-sizing: border-box;
}

.tb-form *,
.tb-form *::before,
.tb-form *::after {
    box-sizing: border-box;
}

/* Barre d'étapes */
.tb-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    position: relative;
    gap: 4px;
}

.tb-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--tb-border);
    z-index: 0;
}

.tb-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    font-size: 11px;
    color: var(--tb-text-light);
    font-weight: 500;
}

.tb-step span {
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--tb-border);
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.25s;
}

.tb-step.active span {
    background: var(--tb-primary);
    border-color: var(--tb-primary);
    color: var(--tb-text);
}

.tb-step.completed span {
    background: var(--tb-text);
    border-color: var(--tb-text);
    color: #fff;
}

.tb-step.active,
.tb-step.completed {
    color: var(--tb-text);
}

/* Panneaux */
.tb-panel {
    display: none;
    animation: tbFade 0.3s ease;
}

.tb-panel.active {
    display: block;
}

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

/* Switch mode */
.tb-mode-switch {
    display: flex;
    background: var(--tb-bg-alt);
    border-radius: var(--tb-radius);
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}

.tb-mode-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--tb-text-light);
    transition: all 0.2s;
}

.tb-mode-btn.active {
    background: var(--tb-text);
    color: #fff;
}

/* Champs */
.tb-field {
    margin-bottom: 16px;
}

.tb-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--tb-text);
}

.tb-field input[type="text"],
.tb-field input[type="email"],
.tb-field input[type="tel"],
.tb-field input[type="date"],
.tb-field input[type="time"],
.tb-field input[type="number"],
.tb-field textarea,
.tb-field select {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--tb-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.tb-field input:focus,
.tb-field textarea:focus,
.tb-field select:focus {
    outline: none;
    border-color: var(--tb-primary);
    box-shadow: 0 0 0 3px rgba(240, 192, 64, 0.15);
}

.tb-field.tb-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.tb-field.tb-checkbox input {
    width: auto;
    margin: 0;
}

.tb-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Boutons */
.tb-btn {
    display: inline-block;
    padding: 14px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}

.tb-btn-primary {
    background: var(--tb-primary);
    color: var(--tb-text);
    width: 100%;
}

.tb-btn-primary:hover:not(:disabled) {
    background: var(--tb-primary-dark);
}

.tb-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tb-btn-secondary {
    background: var(--tb-bg-alt);
    color: var(--tb-text);
}

.tb-btn-secondary:hover {
    background: var(--tb-border);
}

.tb-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.tb-buttons .tb-btn-primary {
    flex: 1;
}

.tb-section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 20px 0 12px;
}

/* Carte */
.tb-map {
    width: 100%;
    height: 280px;
    border-radius: var(--tb-radius);
    margin-bottom: 15px;
    background: var(--tb-bg-alt);
}

.tb-trip-info {
    margin-bottom: 15px;
}

.tb-trip-meta {
    display: flex;
    gap: 20px;
    padding: 12px 15px;
    background: var(--tb-bg-alt);
    border-radius: 8px;
    font-size: 14px;
}

/* Véhicules */
.tb-vehicles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tb-vehicle-card {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 2px solid var(--tb-border);
    border-radius: var(--tb-radius);
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.tb-vehicle-card:hover {
    border-color: var(--tb-text-light);
}

.tb-vehicle-card.selected {
    border-color: var(--tb-primary);
    background: #fffbf0;
    box-shadow: 0 0 0 3px rgba(240, 192, 64, 0.15);
}

.tb-vehicle-img img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.tb-vehicle-body h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
}

.tb-vehicle-desc {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--tb-text-light);
}

.tb-vehicle-specs {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--tb-text-light);
}

.tb-vehicle-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--tb-text);
    text-align: right;
    white-space: nowrap;
}

/* Récapitulatif */
.tb-summary-box {
    background: var(--tb-bg-alt);
    border-radius: var(--tb-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.tb-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
    gap: 12px;
}

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

.tb-summary-row span {
    color: var(--tb-text-light);
}

.tb-summary-row strong {
    text-align: right;
}

.tb-summary-total {
    font-size: 17px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--tb-primary) !important;
}

/* Paiement */
.tb-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.tb-pay-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--tb-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.tb-pay-option:has(input:checked) {
    border-color: var(--tb-primary);
    background: #fffbf0;
}

.tb-pay-wrapper {
    margin-bottom: 15px;
}

#tb-card-element {
    padding: 14px;
    border: 1.5px solid var(--tb-border);
    border-radius: 8px;
    background: #fff;
}

.tb-card-errors {
    color: #d64040;
    font-size: 13px;
    margin-top: 8px;
}

/* Messages */
.tb-error {
    padding: 12px 15px;
    background: #fdecec;
    color: #b42424;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
}

.tb-loading {
    text-align: center;
    padding: 30px;
    color: var(--tb-text-light);
    font-size: 14px;
}

.tb-form-error:empty,
.tb-payment-status:empty {
    display: none;
}

/* ==========================================================================
   Compte client
   ========================================================================== */

.tb-account {
    max-width: 760px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tb-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 12px;
}

.tb-account-header h2 {
    margin: 0;
    font-size: 22px;
}

.tb-bookings-list {
    display: grid;
    gap: 12px;
}

.tb-booking-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.tb-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
}

.tb-booking-id {
    font-weight: 700;
    font-size: 14px;
}

.tb-booking-body {
    padding: 15px;
}

.tb-booking-row {
    padding: 6px 0;
    font-size: 14px;
}

.tb-booking-row strong {
    color: #666;
    font-weight: 600;
    margin-right: 6px;
}

.tb-booking-price {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 6px;
    font-size: 16px;
}

.tb-empty {
    text-align: center;
    padding: 40px;
    background: #f7f7f7;
    border-radius: 10px;
    color: #666;
}

/* Statuts */
.tb-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.tb-status-tb-pending   { background: #fff4d6; color: #8a6500; }
.tb-status-tb-paid      { background: #d6f1e0; color: #1a7040; }
.tb-status-tb-completed { background: #d6e6f1; color: #1a4a70; }
.tb-status-tb-cancelled { background: #f1d6d6; color: #8a1a1a; }

/* ==========================================================================
   Login / Thankyou
   ========================================================================== */

.tb-login {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.tb-login h2 {
    margin: 0 0 8px;
    text-align: center;
}

.tb-login-info {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.tb-login input[type="text"],
.tb-login input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 15px;
    box-sizing: border-box;
}

.tb-login .button-primary,
.tb-login .button {
    width: 100%;
    padding: 12px;
    background: #f0c040;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.tb-login-links,
.tb-login-hint {
    text-align: center;
    font-size: 13px;
    margin-top: 15px;
}

.tb-login-hint {
    color: #666;
    padding: 12px;
    background: #f7f7f7;
    border-radius: 8px;
}

.tb-thankyou {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.tb-thankyou-icon {
    color: #1a7040;
    width: 80px;
    margin: 0 auto 20px;
}

.tb-thankyou h1 {
    margin: 0 0 12px;
    font-size: 28px;
}

.tb-thankyou-lead {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
}

.tb-thankyou-details {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    margin-bottom: 20px;
}

.tb-thankyou-details h3 {
    margin: 0 0 12px;
    text-align: center;
}

.tb-thankyou-details table {
    width: 100%;
    border-collapse: collapse;
}

.tb-thankyou-details th,
.tb-thankyou-details td {
    padding: 8px 4px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 14px;
}

.tb-thankyou-details th {
    text-align: left;
    color: #666;
    font-weight: 500;
}

.tb-thankyou-details td {
    text-align: right;
}

.tb-thankyou-total {
    font-size: 17px !important;
}

.tb-thankyou-total th,
.tb-thankyou-total td {
    border-bottom: none;
    border-top: 2px solid #f0c040;
    padding-top: 12px !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .tb-form {
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
    }

    .tb-step {
        font-size: 10px;
    }

    .tb-step span {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .tb-vehicle-card {
        grid-template-columns: 70px 1fr;
        grid-template-rows: auto auto;
    }

    .tb-vehicle-price {
        grid-column: 1 / -1;
        text-align: left;
        border-top: 1px solid #eee;
        padding-top: 10px;
        margin-top: 6px;
    }

    .tb-vehicle-img img {
        width: 70px;
        height: 55px;
    }

    .tb-buttons {
        flex-direction: column;
    }

    .tb-grid-2 {
        grid-template-columns: 1fr;
    }

    .tb-map {
        height: 220px;
    }
}

@media (min-width: 900px) {
    .tb-form {
        padding: 30px;
    }
}

/* ==========================================================================
   Pagination espace client (v1.1)
   ========================================================================== */

.tb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.tb-pagination a,
.tb-pagination span {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    color: var(--tb-text);
}

.tb-pagination a {
    background: #fff;
    border: 1px solid var(--tb-border);
    transition: background 0.15s;
}

.tb-pagination a:hover {
    background: var(--tb-primary);
}

.tb-pagination span.disabled {
    opacity: 0.4;
}

.tb-page-info {
    color: var(--tb-text-light);
    font-size: 13px;
}

.tb-count {
    color: var(--tb-text-light);
    font-weight: 400;
    font-size: 14px;
    margin-left: 6px;
}
