/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --rouge: #C0392B;
    --orange: #E67E22;
    --jaune: #F4D03F;
    --vert: #27AE60;
    --brun: #5D4037;
    --brun-light: #8D6E63;
    --blanc: #FFFFFF;
    --creme: #FFF8F0;
    --rouge-light: rgba(192, 57, 43, 0.1);
    --vert-light: rgba(39, 174, 96, 0.1);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--blanc);
    color: var(--brun);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== DECORATIVE BUBBLES ===== */
.bubble {
    position: fixed;
    border-radius: 50%;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

.bubble-1 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle at 30% 30%, var(--orange), var(--rouge));
    top: -40px;
    left: -60px;
}

.bubble-2 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 40% 40%, var(--jaune), var(--orange));
    top: 15%;
    right: -30px;
}

.bubble-3 {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 50% 50%, var(--vert), #1a7a42);
    top: 35%;
    left: 10px;
}

.bubble-4 {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle at 30% 70%, var(--rouge), #8B2020);
    bottom: 20%;
    right: -50px;
}

.bubble-5 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 60% 30%, var(--jaune), var(--orange));
    bottom: 5%;
    left: -20px;
}

.bubble-6 {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 50% 50%, #5DADE2, #2E86C1);
    top: 8%;
    left: 60%;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    position: relative;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 16px;
}

.hearts {
    margin-bottom: 8px;
    color: var(--rouge);
}

.heart {
    display: inline-block;
    animation: heartbeat 2s ease-in-out infinite;
}

.heart-1 { animation-delay: 0s; }
.heart-2 { animation-delay: 0.5s; margin-left: 4px; }

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brun);
    line-height: 1.2;
    margin-bottom: 4px;
}

.date {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: var(--brun-light);
    font-weight: 600;
}

/* ===== MESSAGES ===== */
.message {
    text-align: center;
    padding: 24px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-weight: 600;
}

.message-success {
    background-color: var(--vert-light);
    color: var(--vert);
    border: 2px solid var(--vert);
}

.message-error {
    background-color: var(--rouge-light);
    color: var(--rouge);
    border: 2px solid var(--rouge);
}

.message-info {
    background-color: var(--creme);
    color: var(--brun);
    border: 2px solid var(--orange);
}

.hearts-celebration {
    margin-top: 12px;
    color: var(--rouge);
}

.hearts-celebration .heart {
    animation: heartbeat 1s ease-in-out infinite;
}

/* ===== FORM ===== */
.field {
    margin-bottom: 20px;
}

.field label:not(.checkbox-label):not(.btn-choice) {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: var(--brun);
}

.required {
    color: var(--rouge);
}

.field input[type="text"],
.field textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: var(--blanc);
    color: var(--brun);
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    min-height: 48px;
}

.field input[type="text"]:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

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

.field input::placeholder,
.field textarea::placeholder {
    color: #aaa;
}

.field-error {
    display: none;
    color: var(--rouge);
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 600;
}

.field.has-error input,
.field.has-error textarea {
    border-color: var(--rouge);
}

.field.has-error .field-error {
    display: block;
}

/* ===== RADIO BUTTON GROUP (Presence & Repas) ===== */
.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.btn-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 56px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-oui {
    border-color: var(--vert);
    color: var(--vert);
    background: var(--blanc);
}

input[type="radio"]:checked + .btn-oui {
    background: var(--vert);
    color: var(--blanc);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-non {
    border-color: var(--rouge);
    color: var(--rouge);
    background: var(--blanc);
}

input[type="radio"]:checked + .btn-non {
    background: var(--rouge);
    color: var(--blanc);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

.btn-vege {
    border-color: var(--vert);
    color: var(--vert);
    background: var(--blanc);
}

input[type="radio"]:checked + .btn-vege {
    background: var(--vert);
    color: var(--blanc);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-viande {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--blanc);
}

input[type="radio"]:checked + .btn-viande {
    background: var(--orange);
    color: var(--blanc);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

/* ===== CONDITIONAL FIELDS ===== */
.conditional-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.conditional-fields.visible {
    max-height: 500px;
    opacity: 1;
}

/* ===== CHECKBOXES ===== */
.field-checkbox {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.checkbox-label:has(input:checked) {
    border-color: var(--orange);
    background: rgba(230, 126, 34, 0.05);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 1px;
}

.checkmark::after {
    content: '';
    width: 6px;
    height: 12px;
    border: solid var(--blanc);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

.checkbox-label input:checked ~ .checkmark {
    background: var(--orange);
    border-color: var(--orange);
}

.checkbox-label input:checked ~ .checkmark::after {
    opacity: 1;
}

.price {
    color: var(--brun-light);
    font-size: 0.9rem;
}

/* ===== CONDITIONS (la blague) ===== */
.field-conditions {
    margin-top: 28px;
    margin-bottom: 24px;
}

.field-conditions .checkbox-label {
    border-color: var(--rouge);
    background: rgba(192, 57, 43, 0.03);
}

.field-conditions .checkbox-label:has(input:checked) {
    border-color: var(--vert);
    background: rgba(39, 174, 96, 0.05);
}

.field-conditions .checkmark {
    border-color: var(--rouge);
}

.field-conditions input:checked ~ .checkmark {
    background: var(--vert);
    border-color: var(--vert);
}

.conditions-text {
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== SUBMIT BUTTON ===== */
.btn-submit {
    display: block;
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    color: var(--blanc);
    background: linear-gradient(135deg, var(--orange), var(--rouge));
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 16px rgba(192, 57, 43, 0.3);
}

.btn-submit:active {
    transform: scale(0.97);
}

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

/* ===== FORM NOTICE ===== */
.form-notice {
    text-align: center;
    font-size: 0.9rem;
    color: var(--brun-light);
    font-style: italic;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: rgba(244, 208, 63, 0.12);
    border-radius: 8px;
}

/* ===== ACTIVITIES SECTION ===== */
.activities-section {
    margin-top: 40px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.06), rgba(244, 208, 63, 0.08));
    border-radius: 16px;
    text-align: center;
}

.activities-title {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: var(--brun);
    margin-bottom: 4px;
}

.activities-text {
    font-size: 0.9rem;
    color: var(--brun-light);
    margin-bottom: 16px;
}

.activities-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--blanc);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.contact-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--brun);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}

.btn-whatsapp:active {
    background: #1da851;
    transform: scale(0.96);
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: var(--brun-light);
    font-size: 0.85rem;
}

/* ===== DUPLICATE CONFIRMATION PAGE ===== */
.duplicate-warning {
    text-align: center;
    padding: 24px;
    background: rgba(230, 126, 34, 0.08);
    border: 2px solid var(--orange);
    border-radius: 16px;
    margin-bottom: 24px;
}

.duplicate-warning p {
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--brun);
}

.duplicate-actions {
    display: flex;
    gap: 12px;
}

.duplicate-actions .btn-confirm {
    flex: 1;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    text-align: center;
}

.btn-confirm-yes {
    background: var(--vert);
    color: var(--blanc);
}

.btn-confirm-no {
    background: #eee;
    color: var(--brun);
}

/* ===== ADMIN STYLES ===== */
.admin-header {
    text-align: center;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: var(--brun);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-total { background: var(--creme); color: var(--brun); }
.stat-presents { background: rgba(39, 174, 96, 0.1); color: var(--vert); }
.stat-absents { background: rgba(192, 57, 43, 0.1); color: var(--rouge); }
.stat-vege { background: rgba(39, 174, 96, 0.1); color: var(--vert); }
.stat-viande { background: rgba(230, 126, 34, 0.1); color: var(--orange); }
.stat-dormeurs { background: rgba(93, 64, 55, 0.1); color: var(--brun); }
.stat-dejeuner { background: rgba(244, 208, 63, 0.15); color: #9A7D0A; }

.admin-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-export {
    flex: 1;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    background: var(--vert);
    color: var(--blanc);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

/* ===== GUEST CARDS (mobile) ===== */
.guest-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guest-card {
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #eee;
    position: relative;
}

.guest-card.present {
    border-left: 4px solid var(--vert);
}

.guest-card.absent {
    border-left: 4px solid var(--rouge);
    opacity: 0.7;
}

.guest-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.guest-surnom {
    font-style: italic;
    color: var(--brun-light);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.guest-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.guest-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-present { background: rgba(39, 174, 96, 0.1); color: var(--vert); }
.tag-absent { background: rgba(192, 57, 43, 0.1); color: var(--rouge); }
.tag-vege { background: rgba(39, 174, 96, 0.1); color: var(--vert); }
.tag-viande { background: rgba(230, 126, 34, 0.1); color: var(--orange); }
.tag-dormir { background: rgba(93, 64, 55, 0.1); color: var(--brun); }
.tag-dejeuner { background: rgba(244, 208, 63, 0.15); color: #9A7D0A; }

.guest-remarques {
    font-size: 0.85rem;
    color: var(--brun-light);
    font-style: italic;
    margin-bottom: 8px;
}

.guest-date {
    font-size: 0.75rem;
    color: #aaa;
}

.guest-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--rouge);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.guest-delete:active {
    opacity: 1;
}

/* ===== DESKTOP TABLE (admin, >768px) ===== */
@media (min-width: 768px) {
    .container {
        max-width: 900px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .guest-list-mobile { display: none; }

    .guest-table {
        display: table;
        width: 100%;
        border-collapse: collapse;
    }

    .guest-table th,
    .guest-table td {
        padding: 12px 8px;
        text-align: left;
        border-bottom: 1px solid #eee;
        font-size: 0.9rem;
    }

    .guest-table th {
        font-weight: 700;
        color: var(--brun);
    }

    .guest-table .btn-delete-row {
        background: none;
        border: none;
        color: var(--rouge);
        cursor: pointer;
        font-size: 1rem;
        padding: 4px;
    }
}

@media (max-width: 767px) {
    .guest-table { display: none; }
}

/* ===== NO GUESTS ===== */
.no-guests {
    text-align: center;
    padding: 40px 20px;
    color: var(--brun-light);
    font-style: italic;
}
