* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #163a5a 0%, #274982 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #15395a 0%, #113554 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 40px;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.header p {
    position: relative;
    z-index: 1;
}

.content {
    padding: 40px;
}

.form-section {
    background: #f8f9fa;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 15px;
    border-left: 5px solid #2a4c78;
}

.form-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
}

.form-section h3::before {
    content: "📋";
    margin-right: 10px;
    font-size: 1.2em;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 0.95em;
}

input, select, textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #162b4b;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

.km-section {
    background: #e8f5e8;
    border-left-color: #a27232;
}

.km-section h3::before {
    content: "🚗";
}

.autres-frais {
    background: #fff3cd;
    border-left-color: #7b3e13;
}

.autres-frais h3::before {
    content: "💰";
}

.frais-item, .trajet-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    position: relative;
}

.frais-item:hover, .trajet-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1em;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #2d608b 0%, #255184 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #385363 0%, #1f566d 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #365479 0%, #274e91 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.total-section {
    background: linear-gradient(135deg, #17296a 0%, #143361 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin: 30px 0;
}

.total-amount {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.logo-upload {
    text-align: center;
    margin-bottom: 20px;
}

.logo-preview {
    max-width: 150px;
    max-height: 80px;
    margin-top: 10px;
    border: 2px dashed #ddd;
    padding: 10px;
    border-radius: 10px;
}

.signature-section {
    text-align: right;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.signature-line {
    border-bottom: 2px solid #333;
    width: 200px;
    margin: 20px 0 10px auto;
}

/* MEDIA QUERIES POUR MOBILE */

/* Tablettes et petits écrans */
@media screen and (max-width: 768px) {
    .container {
        border-radius: 0;
        margin: 0;
    }
    
    .header {
        margin-top: 0;
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .form-section {
        padding: 15px;
        border-radius: 10px;
    }
    
    .form-section h3 {
        font-size: 1.1em;
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        padding: 15px 20px;
    }
    
    .total-amount {
        font-size: 2em;
    }
    
    .total-section {
        padding: 20px 15px;
    }
    
    .frais-item, .trajet-item {
        padding: 15px;
    }
}

/* Smartphones */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .header p {
        font-size: 0.9em;
    }
    
    .content {
        padding: 15px 10px;
    }
    
    .form-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .form-section h3 {
        font-size: 1em;
        margin-bottom: 15px;
    }
    
    input, select, textarea {
        padding: 10px 12px;
        font-size: 16px; /* Évite le zoom automatique sur iOS */
    }
    
    label {
        font-size: 0.9em;
        margin-bottom: 5px;
    }
    
    .btn {
        padding: 12px 15px;
        font-size: 0.95em;
    }
    
    .total-amount {
        font-size: 1.8em;
    }
    
    .total-section p {
        font-size: 0.9em;
    }
    
    .frais-item, .trajet-item {
        padding: 12px;
    }
    
    /* Amélioration des espacements pour mobile */
    .form-row {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .actions {
        gap: 10px;
        margin-top: 20px;
    }
    
    /* Logo plus petit sur mobile */
    .logo-preview {
        max-width: 100px;
        max-height: 60px;
    }
}

/* Très petits écrans */
@media screen and (max-width: 360px) {
    .header h1 {
        font-size: 1.3em;
    }
    
    .form-section h3 {
        font-size: 0.95em;
    }
    
    .total-amount {
        font-size: 1.5em;
    }
    
    input, select, textarea {
        padding: 8px 10px;
    }
}

/* Optimisation du paysage sur mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.6em;
    }
    
    .content {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}