/* These are overridden at runtime by js/config.js from the admin-editable
   config, so every hardcoded color below is really just the fallback. */
:root{
    --color-red:#e2001a;
    --color-red-dark:#c8002f;
    --color-blue:#3ab5f2;
    --color-blue-light:#63c7ff;
    --color-navy:#003f7d;
    --color-text:#222222;
    --color-cta-text:#7a1c1c;
    --color-wheel-bg:#003f7d;
    --color-wheel-top:#f2c6cd;
    --color-prize-bg:#ffd23f;
    --color-prize-text:#7a1c1c;

    /* Winner (result.html) page's own palette — independent of the colors
       above, admin-editable from the "Résultat" tab. */
    --result-bg:#003f7d;
    --result-secondary:#3ab5f2;
    --result-card:#ffffff;
    --result-primary:#e2001a;
    --result-border:#e2001a;
    --result-text:#1a1a1a;
    --result-button:#003f7d;
    --result-success:#22c55e;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Poppins',sans-serif;
}

body{
    min-height:100vh;
    min-height:100dvh;
    display:flex;
    justify-content:center;
    background:#ece8e0;
    overflow-x:hidden;
}

/* Hides the page until js/config.js has applied the real tombola's colors
   (see the "colors-pending" class removal there) — otherwise every refresh
   paints once with the hardcoded fallback colors above (Colgate's red)
   before flashing to the correct ones once GET /api/config resolves. */
html.colors-pending body{
    visibility:hidden;
}

/* ---------- Admin-editable text styling (Textes tab) ----------
   Applied by js/config.js's applyConfigTextStyles() from each field's
   saved textStyles entry — toggles combine freely, the effect is a
   single choice among the four below. */
.text-style-bold{ font-weight:800; }
.text-style-italic{ font-style:italic; }
.text-style-underline{ text-decoration:underline; }
.text-style-uppercase{ text-transform:uppercase; }
.text-field-hidden{ display:none !important; }

.text-effect-metallic-gold{
    background:linear-gradient(135deg,#bf953f 0%,#fcf6ba 25%,#b38728 50%,#fbf5b7 75%,#aa771c 100%);
    -webkit-background-clip:text;
    background-clip:text;
    -webkit-text-fill-color:transparent;
    color:transparent;
}

.text-effect-metallic-silver{
    background:linear-gradient(135deg,#8e9296 0%,#f5f5f5 25%,#7c7c7c 50%,#eaeaea 75%,#6b6b6b 100%);
    -webkit-background-clip:text;
    background-clip:text;
    -webkit-text-fill-color:transparent;
    color:transparent;
}

.text-effect-glow{
    text-shadow:0 0 6px currentColor,0 0 14px currentColor;
}

.text-effect-shadow{
    text-shadow:2px 3px 6px rgba(0,0,0,.45);
}

.container{
    position:relative;
    width:100%;
    max-width:430px;
    min-height:100vh;
    min-height:100dvh;
    background:#fff;
    border-radius:40px;
    overflow:hidden;
    box-shadow:0 15px 40px rgba(0,0,0,.15);
}

/* ---------- Header ---------- */

header{
    position:relative;
    z-index:2;
    background:#fff;
    padding:26px 22px 16px;
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    gap:10px;
}

header > *:first-child{
    justify-self:start;
}

header > *:last-child{
    justify-self:end;
}

.logo{
    height:48px;
    object-fit:contain;
    justify-self:center;
}

.logo.marjane{
    height:58px;
}

.logo.colgate{
    height:32px;
}

.language-btn{
    border:2px solid var(--color-red);
    background:#fff;
    color:var(--color-red);
    padding:8px 16px;
    border-radius:30px;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
    white-space:nowrap;
    transition:.25s;
}

.language-btn:hover{
    background:var(--color-red);
    color:#fff;
}

/* ---------- Buttons ---------- */

.btn-primary{
    width:100%;
    border:none;
    background:var(--color-navy);
    color:#fff;
    padding:18px;
    border-radius:18px;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    transition:.3s;
    box-shadow:0 8px 20px rgba(0,63,125,.35);
}

.btn-primary:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 25px rgba(0,63,125,.45);
}

.btn-primary:active{
    transform:scale(.97);
}

.btn-primary:disabled{
    opacity:.7;
    cursor:not-allowed;
    transform:none;
}

.btn-outline{
    width:100%;
    border:2px solid var(--color-red);
    background:#fff;
    color:var(--color-red);
    padding:16px;
    border-radius:18px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
    transition:.3s;
    text-decoration:none;
    display:inline-block;
    text-align:center;
}

.btn-outline:hover{
    background:var(--color-red);
    color:#fff;
}

/* ---------- Loading screen ---------- */

#loadingScreen{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.6);
    display:none;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    z-index:999;
    color:#fff;
    font-weight:600;
}

.spinner{
    width:70px;
    height:70px;
    border:6px solid rgba(255,255,255,.25);
    border-top:6px solid #fff;
    border-radius:50%;
    animation:spin 1s linear infinite;
    margin-bottom:15px;
}

@keyframes spin{
    to{transform:rotate(360deg);}
}

@media(max-width:480px){
    .container{
        border-radius:0;
        min-height:100vh;
        min-height:100dvh;
        max-width:100%;
    }
}

/* Prevent the header from squeezing/overlapping on narrow phones (iPhone
   SE and similar ~320-375px screens), where the full-size logos + the
   language pill don't all fit across three grid columns */
@media(max-width:380px){
    header{
        padding:18px 14px 12px;
        gap:6px;
    }

    .logo.marjane{
        height:42px;
    }

    .logo.colgate{
        height:24px;
    }

    .language-btn{
        padding:6px 10px;
        font-size:11px;
    }
}

/* ---------- Desktop ----------
   Full-bleed website, not a scaled-up mobile card: the container fills
   the viewport edge to edge, and each section centers its own content
   up to a max reading width via the "centered padding" trick below,
   so backgrounds still span the full browser width. */

@media(min-width:900px){
    body{
        display:block;
        padding:0;
    }

    .container{
        max-width:100%;
        min-height:100vh;
        margin:0;
        border-radius:0;
        box-shadow:none;
    }

    header{
        padding-left:max(32px, calc((100% - 1200px) / 2));
        padding-right:max(32px, calc((100% - 1200px) / 2));
    }
}
