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

@font-face {
    font-family: 'Dongra';
    src: url('Dongra.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Ajouté pour améliorer le chargement */
}

body {
    font-family: Arial, sans-serif;
    background-color: #fff;
    color: #333;
}

.container {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    display: block;
}

.countdown-wrapper {
    position: relative;
    width: 100%;
}

.countdown-overlay {
    position: absolute;
    top: 79%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 27vw; /* Changé en vw pour être responsive */
    justify-content: center;
    align-items: center;
    z-index: 10;
    width: 90%; /* Ajouté pour éviter le débordement */
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.countdown-number {
    font-size: clamp(24px, 5vw, 48px); /* Taille fluide et responsive */
    font-weight: bold;
    color: #FFB6C1;
    text-shadow: 0.5px 0.5px 2px rgba(0, 0, 0, 0.3);
    font-family: 'Dongra', Arial, sans-serif;
    line-height: 1.2;
}

.form-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background-color: #fff;
}

.custom-form {
    width: 100%;
    max-width: 600px;
    background: #eca79c9c;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
    -webkit-appearance: none; /* Fix pour Safari */
    appearance: none;
}

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

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

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #eca69c 0%, #eca69c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent; /* Fix pour mobile */
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.guests-section {
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 182, 193, 0.1);
    border-radius: 10px;
    border: 2px dashed #eca69c;
}

.guest-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.add-guest-btn {
    width: 100%;
    padding: 12px;
    background: #eca69c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent;
}

.remove-guest-btn {
    width: 100%;
    padding: 8px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #eca69c;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent;
}

/* MEDIA QUERIES - ORDRE CORRIGÉ : DU PLUS GRAND AU PLUS PETIT */

/* Très grands écrans */
@media screen and (min-width: 1441px) {
    .countdown-number {
        font-size: 48px;
    }

    .container-program,
    .container-dress-code,
    .container-form {
        width: 100%;
        max-width: 800px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
}

/* Écrans moyens - tablettes et petits laptops */
@media screen and (max-width: 1440px) {
    .countdown-number {
        font-size: 42px; /* Réduit de 88px à 42px */
    }

    .container-program,
    .container-dress-code,
    .container-form {
        width: 100%;
        max-width: 600px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
}

/* Tablettes */
@media screen and (max-width: 1024px) {
    .countdown-number {
        font-size: 36px;
    }

    .container-program,
    .container-dress-code,
    .container-form {
        width: 100%;
        max-width: 500px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
}

/* Petites tablettes et grands mobiles */
@media screen and (max-width: 780px) {
    .countdown-number {
        font-size: 32px;
    }

    .countdown-overlay {
        gap: 26vw;
    }
}

/* Mobiles standards */
@media screen and (max-width: 480px) {
    .container {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: top center;
    }

    .countdown-overlay {
        gap: 25vw; /* Réduit de 208% à 18vw */
        top: 79%; /* Légèrement ajusté */
    }

    .countdown-number {
        font-size: 26px;
    }

    .form-container {
        padding: 20px 15px;
    }

    .custom-form {
        width: 100%;
        padding: 25px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Important : 16px minimum pour éviter le zoom auto sur iOS */
        padding: 10px;
    }

    .submit-btn {
        font-size: 16px;
        padding: 12px;
    }

    .guests-section {
        padding: 15px;
    }

    .guest-item {
        padding: 15px;
    }

    .add-guest-btn,
    .remove-guest-btn {
        font-size: 12px;
        padding: 10px;
    }
}

/* Très petits mobiles */
@media screen and (max-width: 375px) {
    .countdown-number {
        font-size: 22px;
    }

    .countdown-overlay {
        gap: 25vw;
        top: 79%;
    }
}

/* iPhone SE et petits écrans */
@media screen and (max-width: 320px) {
    .countdown-number {
        font-size: 18px;
    }

    .countdown-overlay {
        gap: 25vw;
        top: 79%;
    }

    .custom-form {
        padding: 20px;
    }
}
