/* assets/style.css */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Outfit:wght@300;500;700&display=swap');

:root {
    --munchy-yellow: #FFCC00;
    --munchy-yellow-dark: #d4a900;
    --munchy-black: #101018;
    --munchy-red: #E63946;
    --text-color: #ffffff;
    --card-bg: rgba(20, 20, 30, 0.9);
    --glass-border: rgba(255, 204, 0, 0.35);

    /* Nouveaux tokens pour le style global */
    --accent-pink: #FF73B8;
    --accent-blue: #6AD5FF;
    --accent-soft: rgba(255, 255, 255, 0.12);
    --radius-xl: 30px;
    --radius-lg: 20px;
    --shadow-strong: 0 24px 80px rgba(0, 0, 0, 0.75);
    --shadow-soft-glow: 0 0 35px rgba(255, 204, 0, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--munchy-black);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 204, 0, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(230, 57, 70, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(106, 213, 255, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a10 0%, #121220 50%, #16162a 100%);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Container recentré et aéré */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* --- CARD PRINCIPALE GLASS --- */
.glass-card {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow:
        0 18px 55px rgba(0, 0, 0, 0.55),
        0 0 35px rgba(255, 204, 0, 0.25);
    max-width: 1100px;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 3rem;
    align-items: center;
    justify-content: space-between;
    position: relative;
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    overflow: hidden;
    animation: floatCard 8s ease-in-out infinite alternate;
}

/* halo décoratif autour de la card */
.glass-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(255, 204, 0, 0.35), transparent 55%);
    opacity: 0.35;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* --- WHEEL STYLES --- */
.wheel-wrapper {
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    max-width: 80vw;
    max-height: 80vw;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 8px solid var(--munchy-yellow);
    box-shadow:
        0 0 35px rgba(255, 204, 0, 0.3),
        0 18px 40px rgba(0, 0, 0, 0.5);
    background: radial-gradient(circle at 30% 20%, #fff8e6 0%, #ffeef7 40%, #ffffff 80%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 4s cubic-bezier(0.15, 0, 0.15, 1);
}

.wheel-center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20%;
    height: 20%;
    background: radial-gradient(circle at 30% 20%, #ffffff 0%, #fff6d6 70%);
    border-radius: 50%;
    border: 3px solid var(--munchy-yellow);
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.25),
        0 0 20px rgba(255, 204, 0, 0.6);
}

.wheel-center-logo img {
    width: 180%;
    height: auto;
}

.wheel-pointer {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--munchy-red), #ff8a7a);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
    z-index: 10;
    filter: drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.45));
}

/* --- CONTENT SIDE --- */
.content-side {
    flex: 1;
    min-width: 300px;
    text-align: left;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Titre principal */
h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 3rem;
    line-height: 1.1;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-image: linear-gradient(135deg, var(--munchy-yellow), #ff9f5f, var(--accent-pink));
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* Sous-titre */
.subtitle {
    font-size: 1.2rem;
    color: rgba(240, 240, 240, 0.85);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* --- FORMS --- */
.input-group {
    margin-bottom: 1rem;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.form-control {
    background: rgba(10, 10, 20, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fdfdfd;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    width: 100%;
    transition: all 0.25s ease;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 0 0 transparent;
}

.form-control::placeholder {
    color: rgba(230, 230, 230, 0.6);
}

.form-control:focus {
    background: rgba(20, 20, 40, 0.8);
    border-color: var(--munchy-yellow);
    outline: none;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

/* Boutons principaux */
.btn-custom {
    background: linear-gradient(135deg, var(--munchy-yellow), #ffdf6a);
    color: var(--munchy-black);
    border: none;
    padding: 1rem 2rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    width: 100%;
    text-transform: uppercase;
    font-weight: 600;
    box-shadow:
        0 5px 0 var(--munchy-yellow-dark),
        0 0 20px rgba(255, 204, 0, 0.35);
    margin-top: 0.5rem;
}

.btn-custom:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow:
        0 8px 0 var(--munchy-yellow-dark),
        0 0 26px rgba(255, 230, 128, 0.7);
    background: linear-gradient(135deg, #ffe066, #ffd43b);
}

.btn-custom:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--munchy-yellow-dark);
}

.btn-custom:disabled {
    background: #3a3a3a;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Variante secondaire */
.btn-custom.secondary {
    background: transparent;
    border: 2px solid var(--munchy-yellow);
    color: var(--munchy-yellow);
    box-shadow: none;
}

.btn-custom.secondary:hover {
    background: var(--munchy-yellow);
    color: var(--munchy-black);
}

.highlight-text {
    color: var(--munchy-red);
    font-family: 'Fredoka', sans-serif;
    font-size: 2.2rem;
    line-height: 1.2;
    display: block;
    margin: 15px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* --- CHECKBOX --- */
.checkbox-wrapper {
    text-align: left;
    margin: 1rem 0;
    padding: 0 0.5rem;
}

.checkbox-wrapper label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.3;
}

.checkbox-wrapper input[type="checkbox"] {
    accent-color: var(--munchy-yellow);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

/* --- RESULT OVERLAY --- */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 204, 0, 0.15), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(230, 57, 70, 0.15), transparent 55%),
        rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
}

.result-card {
    background: rgba(10, 10, 20, 0.95);
    padding: 2.5rem;
    border-radius: 30px;
    text-align: center;
    border: 2px solid var(--glass-border);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 450px;
    width: 100%;
    box-shadow:
        0 0 45px rgba(255, 204, 0, 0.35),
        0 18px 40px rgba(0, 0, 0, 0.7);
}

/* Codes promo */
.coupon-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 2rem 0;
    align-items: center;
}

.coupon-code {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.8rem;
    color: var(--munchy-yellow);
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.12), rgba(255, 255, 255, 0.02));
    border: 3px dashed var(--munchy-yellow);
    padding: 1rem 2rem;
    border-radius: 15px;
    transform: rotate(-2deg);
    word-break: break-all;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.18s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.copy-btn:hover {
    border-color: var(--munchy-yellow);
    color: var(--munchy-yellow);
    box-shadow: 0 0 16px rgba(255, 204, 0, 0.6);
}

.promo-text {
    margin: 1rem 0 2rem 0;
    font-size: 0.9rem;
    color: #ccc;
}

.promo-link {
    color: var(--munchy-yellow);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.promo-link:hover {
    border-bottom-color: var(--munchy-yellow);
}

/* --- ANIMATIONS --- */
@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes floatCard {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}

/* ==========================================
   MOBILE RESPONSIVENESS (Corrected & Optimized)
   ========================================== */

/* Tablets and Mobile landscape */
@media (max-width: 950px) {
    .glass-card {
        flex-direction: column;
        padding: 2rem;
        gap: 2rem;
    }

    .content-side {
        width: 100%;
        min-width: auto;
        text-align: center;
        align-items: center;
    }

    h1 {
        font-size: 2.5rem;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    body {
        min-height: 100vh;
        height: auto;
    }

    .main-container {
        padding: 0.5rem;
    }

    .glass-card {
        padding: 1.5rem 1rem;
        border-radius: 20px;
        gap: 1.5rem;
        border-width: 1px;
        animation: none; /* évite trop de mouvement sur mobile */
    }

    .wheel-container {
        width: 300px;
        max-width: 85vw;
        max-height: 85vw;
        height: auto;
        border-width: 5px;
    }

    .wheel-pointer {
        right: -15px;
        width: 35px;
        height: 35px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 0.2rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .btn-custom {
        font-size: 1.1rem;
        padding: 0.9rem;
    }

    .form-control {
        padding: 0.8rem 1rem;
        font-size: 16px;
    }

    .highlight-text {
        font-size: 1.8rem;
    }

    .result-card {
        padding: 1.5rem;
        width: 95%;
    }

    .coupon-code {
        font-size: 2rem;
        padding: 0.8rem 1rem;
    }
}
