:root {
    --primary: #0f4c81;
    --primary-light: #1a6bb3;
    --primary-dark: #0a3a5c;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --bg: #f0f4f8;
    --card-bg: #fff;
    --text: #1e293b;
    --text-muted: #64748b;
    --error: #dc2626;
    --success: #059669;
    --gradient-header: linear-gradient(135deg, #0f4c81 0%, #1a6bb3 50%, #0a3a5c 100%);
    --gradient-bg: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    --shadow-card: 0 4px 16px rgba(15, 76, 129, 0.1);
    --shadow-card-hover: 0 16px 40px rgba(15, 76, 129, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding-top: 64px;
    background: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: pageLoad 0.4s ease;
}

@keyframes pageLoad {
    from { opacity: 0; }
    to { opacity: 1; }
}

.header {
    background: var(--gradient-header);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(15, 76, 129, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.header h1 a {
    color: white;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px;
    transition: background 0.2s ease;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.header nav,
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header nav a,
.nav-menu a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
}

.header nav a:hover,
.nav-menu a:hover {
    color: var(--accent-light);
    transform: translateY(-2px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    body {
        padding-top: 64px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--gradient-header);
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    }

    .nav-menu.open {
        max-height: 400px;
        opacity: 1;
    }

    .nav-menu a {
        padding: 0.75rem 1rem;
        width: 100%;
        text-align: center;
    }

    .nav-menu .user-name {
        padding: 0.5rem;
    }
}

.user-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

.main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.main h2 {
    margin-top: 0;
    color: var(--primary-dark);
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
    animation: fadeInDown 0.5s ease;
}

.main h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 2px;
    animation: slideIn 0.6s ease 0.2s both;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 60px;
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
}

.vehicle-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(15, 76, 129, 0.12);
    animation: fadeInUp 0.5s ease both;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(245, 158, 11, 0.3);
}

.vehicle-card.expanded {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.vehicle-card-summary {
    display: flex;
    flex-direction: column;
}

.vehicle-card-preview {
    padding: 1rem 1.25rem;
}

.vehicle-card-preview h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: var(--primary);
}

.vehicle-click-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.vehicle-card.expanded .vehicle-click-hint {
    display: none;
}

.vehicle-card-details {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.25rem;
    border-top: 1px solid transparent;
    transition: max-height 0.35s ease, padding 0.3s ease;
}

.vehicle-card.expanded .vehicle-card-details {
    max-height: 500px;
    padding: 1rem 1.25rem 1.25rem;
    border-top-color: rgba(15, 76, 129, 0.1);
}

.vehicle-description {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
}

.vehicle-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    overflow: hidden;
    flex-shrink: 0;
}

.vehicle-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

@media (max-width: 600px) {
    .vehicle-card-image {
        height: 180px;
    }
}

.vehicle-card:hover .vehicle-card-image img {
    transform: scale(1.05);
}

.vehicle-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(26, 54, 93, 0.4);
}

.vehicle-year {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.vehicle-card-details .vehicle-specs {
    margin: 0 0 0.5rem;
}

.vehicle-specs {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #4a5568;
}

.vehicle-specs li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.spec-icon {
    opacity: 0.8;
}

.vehicle-tech {
    margin: 0.5rem 0 0.75rem;
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
}

.vehicle-card-preview .vehicle-prices,
.vehicle-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.vehicle-card-preview .vehicle-prices {
    margin-bottom: 0;
}

.vehicle-card-details .vehicle-prices {
    margin-bottom: 1rem;
}

.price-tag {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-light);
}

.price-tag.sale {
    color: var(--accent);
}

.vehicle-card .actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-rent {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(15, 76, 129, 0.3);
}

.btn-rent:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(15, 76, 129, 0.4);
}

.btn-buy {
    background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.btn-buy:hover {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(15, 76, 129, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 4px 12px rgba(15, 76, 129, 0.4);
}

.form-page {
    max-width: 400px;
}

.buy-page {
    max-width: 720px;
}

.buy-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(15, 76, 129, 0.1);
    flex-wrap: wrap;
}

.buy-vehicle-image {
    position: relative;
    width: 280px;
    min-width: 240px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

.buy-vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.buy-vehicle-image .vehicle-year-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.buy-vehicle-info {
    flex: 1;
    min-width: 240px;
}

.buy-vehicle-info h3 {
    margin: 0 0 0.5rem;
    color: var(--primary-dark);
    font-size: 1.4rem;
}

.buy-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.buy-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--text);
}

.buy-specs li {
    padding: 0.2rem 0;
}

.buy-total-price {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary);
}

.buy-form {
    margin-top: 1.5rem;
}

.buy-form fieldset {
    border: 1px solid rgba(15, 76, 129, 0.15);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.buy-form legend {
    font-weight: 600;
    color: var(--primary-dark);
    padding: 0 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
    color: var(--text);
}

.rent-page {
    max-width: 720px;
}

.rent-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(15, 76, 129, 0.1);
    flex-wrap: wrap;
}

.rent-vehicle-image {
    position: relative;
    width: 280px;
    min-width: 240px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

.rent-vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rent-vehicle-image .vehicle-year-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.rent-vehicle-image .vehicle-status-badge {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.rent-vehicle-image .status-available {
    background: var(--success);
    color: white;
}

.rent-vehicle-image .status-reserved {
    background: var(--text-muted);
    color: white;
}

.rent-vehicle-info {
    flex: 1;
    min-width: 240px;
}

.rent-vehicle-info h3 {
    margin: 0 0 0.75rem;
    color: var(--primary-dark);
    font-size: 1.4rem;
}

.rent-specs {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
}

.rent-specs li {
    padding: 0.35rem 0;
}

.rent-form fieldset {
    border: 1px solid rgba(15, 76, 129, 0.15);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.rent-form legend {
    font-weight: 600;
    color: var(--primary-dark);
    padding: 0 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 140px;
}

input.readonly {
    background: #f1f5f9;
    cursor: default;
}

.my-reservations-page {
    max-width: 900px;
}

.empty-reservations {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.empty-reservations p {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.reservation-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reservation-card {
    display: flex;
    flex-wrap: wrap;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(15, 76, 129, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.reservation-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.reservation-card-image {
    position: relative;
    width: 260px;
    min-width: 220px;
    height: 160px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

.reservation-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reservation-status-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.reservation-status-badge.status-pending {
    background: #f59e0b;
}

.reservation-status-badge.status-confirmed {
    background: var(--success);
}

.reservation-status-badge.status-cancelled {
    background: var(--error);
}

.reservation-status-badge.status-completed {
    background: var(--text-muted);
}

.reservation-card-body {
    flex: 1;
    padding: 1.25rem;
    min-width: 240px;
}

.reservation-card-body h3 {
    margin: 0 0 0.25rem;
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.reservation-type {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.reservation-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1.5rem;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.reservation-details dt {
    margin: 0;
    color: var(--text-muted);
}

.reservation-details dd {
    margin: 0;
}

.reservation-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.reservation-card-actions .inline-form {
    display: inline;
    margin: 0;
}

.btn-details {
    background: var(--primary-light);
    color: white;
}

.btn-details:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-cancel {
    background: #fef2f2;
    color: var(--error);
}

.btn-cancel:hover {
    background: var(--error);
    color: white;
}

.reservation-card-full-details {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.reservation-card-full-details[aria-hidden="false"] {
    display: block;
}

.form {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(15, 76, 129, 0.1);
    animation: fadeInUp 0.5s ease;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 107, 179, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.payment-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.payment-option:hover {
    border-color: var(--primary-light);
    background: rgba(26, 107, 179, 0.05);
}

.payment-option input:checked + .payment-label {
    font-weight: 600;
}

.payment-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(26, 107, 179, 0.08);
}

.payment-label {
    font-size: 1rem;
}

.error {
    color: var(--error);
    margin-bottom: 1rem;
}

.success {
    color: var(--success);
    margin-bottom: 1rem;
}

/* Bandeau alerte invité : pleine largeur, une ligne, fond vert pâle, texte justifié */
.alert-guest-bar {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    background: #d4edda;
    padding: 0 1rem;
    box-sizing: border-box;
}
.alert-guest-bar .alert-guest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: #155724;
    font-size: 0.95rem;
    box-shadow: none;
    min-height: 44px;
}
.alert-guest-bar .alert-guest-text {
    flex: 1;
    text-align: justify;
    line-height: 44px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.alert-guest-bar .alert-guest-text a {
    color: #0d5c1a;
    font-weight: 600;
    text-decoration: underline;
}
.alert-guest-bar .alert-guest-text a:hover {
    color: #0a3d12;
}
.alert-guest-bar .alert-guest-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: rgba(21, 87, 36, 0.2);
    color: #155724;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
}
.alert-guest-bar .alert-guest-close:hover {
    background: rgba(21, 87, 36, 0.35);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(15, 76, 129, 0.1);
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: var(--gradient-header);
    color: white;
    font-weight: 600;
}

.data-table tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, transparent 100%);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(241, 245, 249, 0.5);
}

.data-table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, rgba(241, 245, 249, 0.8) 100%);
}

.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.reservation-list {
    display: grid;
    gap: 1rem;
}

.footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2rem;
}

.reservation-list .vehicle-card {
    animation: fadeInUp 0.4s ease both;
}

.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}
