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

body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    background: linear-gradient(160deg, #2e8b3a 0%, #3dba55 40%, #52c96e 70%, #3dba55 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 16px 40px;
}

/* ===========================
   PAGE WRAPPER
=========================== */
.page-wrapper {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===========================
   CARD
=========================== */
.card {
    width: 100%;
    background: linear-gradient(160deg, #2e8b3a 0%, #3dba55 50%, #52c96e 100%);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.25);
    padding-bottom: 24px;
}

/* ===========================
   LOGO
=========================== */
.logo-wrapper {
    display: flex;
    justify-content: center;
    padding: 30px 30px 0;
}

.logo {
    width: 260px;
    height: 260px;
    object-fit: contain;
    background: #fff;
    border-radius: 22px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ===========================
   TITRE
=========================== */
.form-title {
    text-align: center;
    color: #fff;
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 22px 24px 4px;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.form-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 24px 18px;
}

/* ===========================
   FORMULAIRE
=========================== */
form {
    padding: 8px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ===========================
   FORM GROUP
=========================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    padding-left: 4px;
}

/* ===========================
   INPUT WRAPPER
=========================== */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    overflow: hidden;
    transition: background 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.7);
}

/* Champ désactivé (ex: téléphone quand WhatsApp = OUI) */
.input-disabled {
    background: rgba(200, 200, 200, 0.45) !important;
    cursor: not-allowed;
}

.input-disabled input {
    color: #aaa;
    cursor: not-allowed;
}

.input-disabled .input-icon {
    color: #bbb;
}

/* Icône à gauche */
.input-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-left: 14px;
    color: #888;
    pointer-events: none;
}

/* Input texte / tel */
.input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    color: #333;
    padding: 13px 14px;
}

.input-wrapper input::placeholder {
    color: #b0b0b0;
}

/* Date input styling */
.input-wrapper input[type="date"] {
    color: #555;
    cursor: pointer;
}

.input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(40%);
    cursor: pointer;
}

/* ===========================
   SELECT WRAPPER
=========================== */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    color: #555;
    padding: 13px 40px 13px 14px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    width: 100%;
}

.select-wrapper select option {
    color: #333;
    background: #fff;
}

/* Flèche custom */
.select-arrow {
    position: absolute;
    right: 12px;
    width: 18px;
    height: 18px;
    color: #888;
    pointer-events: none;
    flex-shrink: 0;
}

/* ===========================
   BOUTON S'INSCRIRE
=========================== */
button[type="submit"] {
    margin-top: 10px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1e7a2e, #27a03d);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #186826, #21922f);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
}

button[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

button[type="submit"]:disabled {
    background: #5ba86b;
    cursor: not-allowed;
    transform: none;
}

/* ===========================
   STATUS MESSAGE
=========================== */
#statusMessage {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 22px;
    color: #fff;
    padding-top: 4px;
}

/* ===========================
   FOOTER
=========================== */
.footer-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    margin-top: 20px;
    padding: 0 20px;
}

/* ===========================
   RESPONSIVE — MOBILE PLEIN ÉCRAN
=========================== */
@media (max-width: 520px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .page-wrapper {
        max-width: 100%;
        min-height: 100vh;
    }

    .card {
        border-radius: 0;
        min-height: 100vh;
        padding-bottom: 40px;
    }

    .logo-wrapper {
        padding: 28px 20px 0;
    }

    .logo {
        width: 260px;
        height: 260px;
        max-width: calc(100vw - 60px);
        max-height: calc(100vw - 60px);
    }

    .form-title {
        font-size: 1.6rem;
    }
}

/* ===========================
   SUBMIT ZONE (caché par défaut)
=========================== */
#submitZone {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#submitZone.hidden {
    display: none;
}

/* ===========================
   SUCCESS OVERLAY
=========================== */
.success-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #1a5c28 0%, #2e8b3a 40%, #52c96e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.success-overlay.hidden {
    display: none;
}

.success-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 28px;
    padding: 28px 22px 24px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Logo */
.success-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    animation: bounceIn 0.7s 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.success-logo {
    width: 230px;
    height: 230px;
    object-fit: contain;
    background: #fff;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

@keyframes bounceIn {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Checkmark SVG animé */
.success-checkmark {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    animation: fadeIn 0.4s 0.6s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.checkmark-circle {
    stroke: #fff;
    stroke-width: 3;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeDraw 0.6s 0.7s ease forwards;
}

.checkmark-check {
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeDraw 0.4s 1.3s ease forwards;
}

@keyframes strokeDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Textes */
.success-title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.5s 0.5s ease both;
}

.success-subtitle-msg {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 18px;
    animation: slideUp 0.5s 0.65s ease both;
}

.success-icons {
    font-size: 1.5rem;
    letter-spacing: 5px;
    margin-top: 18px;
    animation: slideUp 0.5s 0.8s ease both;
}

/* ===========================
   CARTES DE CONFIRMATION
=========================== */
.confirmation-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.confirmation-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 13px;
    animation: slideIn 0.4s ease both;
}

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

.card-check {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
}

.card-circle {
    stroke: #52c96e;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeDraw 0.6s ease forwards;
}

.card-tick {
    stroke: #52c96e;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeDraw 0.4s 0.6s ease forwards;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.card-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.card-detail svg {
    flex-shrink: 0;
}

.card-badge {
    display: inline-block;
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 0.72rem;
    font-weight: 700;
}

.card-badge.leader {
    background: rgba(82, 201, 110, 0.35);
    border: 1px solid rgba(82, 201, 110, 0.6);
    color: #c8f5d6;
}

.card-badge.follower {
    background: rgba(255, 200, 80, 0.22);
    border: 1px solid rgba(255, 200, 80, 0.5);
    color: #ffe5a0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Confettis */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9998;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    opacity: 0.9;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===========================
   ADMIN BUTTON
=========================== */
.admin-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ===========================
   LOGIN MODAL
=========================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 380px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #2e8b3a;
    margin-top: 10px;
}

.modal-body .form-group {
    margin-bottom: 14px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2e8b3a, #3dba55);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 139, 58, 0.35);
}

/* ===========================
   ADMIN DASHBOARD
=========================== */
.admin-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #0a2e12, #14532d, #1a7a2e);
    z-index: 3000;
    overflow-y: auto;
    padding: 30px 20px;
    animation: dashboardSlideIn 0.4s ease;
}

@keyframes dashboardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-logo {
    width: 240px;
    height: 240px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.admin-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 3px;
    margin: 12px 0 4px;
}

.admin-subtitle {
    font-family: 'Roboto', sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.admin-header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-logout-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.admin-logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.7);
}

.admin-refresh-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1.5px solid rgba(100, 200, 255, 0.5);
    background: rgba(100, 200, 255, 0.12);
    color: #7dd4f8;
    font-family: 'Roboto', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.admin-refresh-btn:hover {
    background: rgba(100, 200, 255, 0.25);
    border-color: rgba(100, 200, 255, 0.9);
    color: #fff;
}

.admin-content {
    max-width: 500px;
    margin: 0 auto;
}

.admin-content .form-group label {
    color: rgba(255, 255, 255, 0.8);
}

.admin-content .input-wrapper {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-content .input-wrapper select {
    color: #fff;
}

.admin-content .input-wrapper .input-icon {
    color: rgba(255, 255, 255, 0.5);
}

.admin-content .select-arrow {
    color: rgba(255, 255, 255, 0.5);
}

/* ===========================
   STATS GRID
=========================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-number {
    font-family: 'Roboto', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0.7;
}

/* Couleurs individuelles */
.stat-total .stat-number {
    color: #52c96e;
}

.stat-total .stat-label {
    color: #a8e6b4;
}

.stat-total {
    border-color: rgba(82, 201, 110, 0.3);
}

.stat-leader .stat-number {
    color: #64b5f6;
}

.stat-leader .stat-label {
    color: #90caf9;
}

.stat-leader {
    border-color: rgba(100, 181, 246, 0.3);
}

.stat-follower .stat-number {
    color: #ef5350;
}

.stat-follower .stat-label {
    color: #ef9a9a;
}

.stat-follower {
    border-color: rgba(239, 83, 80, 0.3);
}

.stat-repas .stat-number {
    color: #ffb74d;
}

.stat-repas .stat-label {
    color: #ffe0b2;
}

.stat-repas {
    border-color: rgba(255, 183, 77, 0.3);
}

.no-data-msg {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 30px;
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

/* ===========================
   NOMBRE DE PERSONNES — PILLS
=========================== */
.nombre-pills {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 6px 0 2px;
}

.nombre-pill {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nombre-pill:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
}

.nombre-pill.active {
    background: #fff;
    color: #2e8b3a;
    border-color: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    transform: scale(1.12);
}

/* Label centré au-dessus des pills */
.form-group:has(.nombre-pills) label {
    text-align: center;
}

/* ===========================
   BLOCS PERSONNES
=========================== */
.personne-bloc {
    background: rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 14px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

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

.personne-titre {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 9px 22px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: #fff;
}

.personne-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}

/* ===========================
   SUCCESS NAMES
=========================== */
.success-names {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 8px;
    animation: slideUp 0.5s 0.9s ease both;
}