/* =========================================
   BLESC - Global CSS
   Design System & Shared Components
   ========================================= */

/* -----------------------------------------
   CSS VARIABLES
   ----------------------------------------- */
:root {
    /* Couleurs principales */
    --color-bg: #fef3d8;
    --color-dark: #21333E;
    --color-dark-deep: #0D2F3C;
    --color-green: #609E7C;
    --color-green-hover: #4d7e63;
    --color-teal: #17586a;
    --color-teal-hover: #124a5a;
    --color-white: #fff;
    
    /* Couleurs packs */
    --color-pack-curieux: #21333E;
    --color-pack-maestro: #609E7C;
    --color-pack-prodige: #17586a;
    
    /* Couleurs utilitaires */
    --color-danger: #c62828;
    --color-danger-bg: #ffebee;
    --color-danger-hover: #ffcdd2;
    --color-success-bg: #e8f5e9;
    --color-muted: #888;
    --color-border: #eee;
    
    /* Typographie */
    --font-main: 'Inter', Arial, sans-serif;
    --font-logo: 'Blascreb', Arial, sans-serif;
    
    /* Tailles */
    --text-xs: 0.75rem;
    --text-sm: 0.85rem;
    --text-base: 1rem;
    --text-lg: 1.1rem;
    --text-xl: 1.3rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.8rem;
    --text-4xl: 2rem;
    
    /* Espacements */
    --space-xs: 5px;
    --space-sm: 10px;
    --space-md: 15px;
    --space-lg: 20px;
    --space-xl: 30px;
    --space-2xl: 40px;
    
    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    
    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --transition: all 0.2s ease;
}

/* -----------------------------------------
   FONT FACE
   ----------------------------------------- */
@font-face {
    font-family: 'Blascreb';
    src: url('../fonts/Blascreb2.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--color-teal);
    text-decoration: none;
}

a:hover {
    opacity: 0.85;
}

img {
    max-width: 100%;
    height: auto;
}

/* -----------------------------------------
   TYPOGRAPHIE
   ----------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-main);
    color: var(--color-dark);
    margin: 0 0 var(--space-md) 0;
    line-height: 1.2;
}

h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
}

h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
}

h3 {
    font-size: var(--text-xl);
    font-weight: 600;
}

h4 {
    font-size: var(--text-lg);
    font-weight: 600;
}

p {
    margin: 0 0 var(--space-md) 0;
}

.text-muted {
    color: var(--color-dark);
    opacity: 0.7;
}

.text-center {
    text-align: center;
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* -----------------------------------------
   LOGO
   ----------------------------------------- */
.logo {
    width: 140px;
    margin-bottom: var(--space-2xl);
}

@media (max-width: 480px) {
    .logo {
        width: 120px;
        margin-bottom: var(--space-xl);
    }
}

/* -----------------------------------------
   BOUTONS
   ----------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-main);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: var(--transition);
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

/* Bouton principal - Vert */
.btn-primary {
    background: var(--color-green);
    color: var(--color-bg);
}

.btn-primary:hover {
    background: var(--color-green-hover);
}

/* Bouton secondaire - Teal */
.btn-secondary {
    background: var(--color-teal);
    color: var(--color-bg);
}

.btn-secondary:hover {
    background: var(--color-teal-hover);
}

/* Bouton modal - Style arrondi avec shadow */
.btn-modal {
    background: var(--color-green);
    color: var(--color-bg);
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn-modal:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(96, 158, 124, 0.4);
}

/* Bouton tertiaire - Clair */
/* Bouton danger */
.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
}

/* Bouton compact (pour les cards) */
/* Bouton large (pleine largeur) */
/* -----------------------------------------
   ICON BLOCK (style lettre BLESC)
   ----------------------------------------- */
.icon-block {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transform: rotate(-12deg);
    color: var(--color-bg);
    margin-bottom: var(--space-xl);
}

/* -----------------------------------------
   FULL-SCREEN LAYOUT
   (pages message : 404, challenge screens, etc.)
   ----------------------------------------- */
.screen-center {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
    z-index: 9999;
}

.screen-center.hidden {
    display: none;
}

.screen-center .logo {
    width: 140px;
    margin-bottom: var(--space-2xl);
}

.screen-center h1 {
    margin-bottom: var(--space-md);
}

.screen-center p {
    color: var(--color-dark);
    opacity: 0.7;
    margin-bottom: var(--space-xl);
    line-height: 1.5;
    max-width: 320px;
}

.screen-center .icon-block {
    margin-bottom: var(--space-xl);
}

.screen-center .btn {
    margin: var(--space-xs);
}

/* -----------------------------------------
   CARDS (packs)
   ----------------------------------------- */
.card {
    border-radius: var(--radius-xl);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
}

/* -----------------------------------------
   PROGRESS BAR
   ----------------------------------------- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin: var(--space-sm) 0;
}

.progress-bar__fill {
    height: 100%;
    border-radius: 3px;
    background: var(--color-bg);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: var(--text-sm);
    opacity: 0.8;
}

/* -----------------------------------------
   FORM ELEMENTS
   ----------------------------------------- */
.input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: var(--text-base);
    background: var(--color-white);
    color: var(--color-dark);
    transition: var(--transition);
}

.input:focus {
    outline: none;
    border-color: var(--color-teal);
}

.input::placeholder {
    color: var(--color-muted);
}

/* -----------------------------------------
   COUNTDOWN
   ----------------------------------------- */
.countdown {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
}

/* -----------------------------------------
   SPINNER
   ----------------------------------------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* -----------------------------------------
   UTILITIES
   ----------------------------------------- */
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Gap utilities */
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* Padding utilities */
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }

/* -----------------------------------------
   RESPONSIVE
   ----------------------------------------- */
@media (max-width: 480px) {
    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }
    
    .btn {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
    
}
