/* ========================================
   Kadoloko — Design System CSS
   Variables CSS, styles de base, composants
   Complémentaire à Tailwind CSS (CDN)
   ======================================== */

[x-cloak] { display: none !important; }

:root {
    /* Couleurs principales */
    --orange: #F4662A;
    --orange-dark: #D4511A;
    --orange-light: #FEF0E9;
    --green: #00B87A;
    --green-dark: #008F5E;
    --green-light: #E0F7EE;
    --gold: #F5B800;
    --gold-light: #FFF8E0;
    --cream: #F4F4F4;
    --surface: #FFF9F4;
    --white: #FFFFFF;
    --gray-100: #F2F2F0;
    --gray-200: #E0DED8;
    --gray-400: #9E9B93;
    --gray-600: #5C5A54;
    --gray-900: #1A1916;
    --error: #D93025;

    /* Border radius */
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-xl: 36px;

    /* Espacements */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typographie */
    --font-display: 'Sora', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Ombres */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.07);
    --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--cream);
    color: var(--gray-900);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Surface de contenu centrale
   ======================================== */

.bg-surface {
    background-color: var(--surface);
}

/* ========================================
   Boutons
   ======================================== */

.btn {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-xl);
    padding: 15px var(--space-6);
    transition: transform 0.12s, opacity 0.12s;
    text-decoration: none;
    display: inline-block;
    letter-spacing: -0.01em;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.93;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--orange);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(244, 102, 42, 0.3);
}

.btn-secondary {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(0, 184, 122, 0.25);
}

.btn-gold {
    background: var(--gold);
    color: var(--gray-900);
    box-shadow: 0 4px 16px rgba(245, 184, 0, 0.3);
}

.btn-outline-green {
    background: transparent;
    color: var(--green);
    border: 2px solid var(--green);
}

.btn-outline-orange {
    background: transparent;
    color: var(--orange);
    border: 2px solid var(--orange);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    text-decoration: underline;
    padding: 15px var(--space-4);
    font-weight: 400;
    font-family: var(--font-body);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    text-decoration: underline;
    padding: 15px var(--space-4);
    font-weight: 400;
    font-family: var(--font-body);
}

.btn-full {
    display: block;
    width: 100%;
    text-align: center;
}

/* ========================================
   Composants
   ======================================== */

/* Badges */
.badge {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 100px;
    letter-spacing: 0.02em;
    display: inline-block;
}

.badge-rank {
    background: var(--green);
    color: var(--white);
}

.badge-new {
    background: var(--gold);
    color: var(--gray-900);
}

.badge-pending {
    background: var(--gray-600);
    color: var(--white);
}

.badge-approved {
    background: var(--green);
    color: var(--white);
}

.badge-rejected {
    background: var(--error);
    color: var(--white);
}

.badge-lottery {
    background: var(--orange);
    color: var(--white);
}

/* Barre de progression */
.progress-bar {
    background: var(--gray-200);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
}

.progress-fill-orange {
    background: linear-gradient(90deg, var(--orange), var(--gold));
    height: 100%;
    border-radius: 100px;
}

.progress-fill-green {
    background: linear-gradient(90deg, var(--green), #00E09B);
    height: 100%;
    border-radius: 100px;
}

/* Cartes colorées (dégradé) */
.card-gradient {
    background: linear-gradient(135deg, #00B87A 0%, #00C87A 30%, #F5B800 60%, #F4662A 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0, 184, 122, 0.35);
}

/* Carte gold */
.card-gold {
    background: var(--gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(245, 184, 0, 0.3);
}

/* Carte blanche standard */
.card-white {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* Carte commerçant */
.card-merchant {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.card-merchant-img {
    height: 120px;
    background: linear-gradient(135deg, var(--green-light), var(--gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
}

/* Célébration */
.celebration {
    background: linear-gradient(135deg, #00B87A 0%, #00C87A 30%, #F5B800 60%, #F4662A 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 184, 122, 0.35);
    position: relative;
    overflow: hidden;
}

.celebration::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* Code de vérification (coupon) */
.verification-code {
    font-family: monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-5);
    text-align: center;
}

/* Timer */
.timer {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: -0.02em;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--gray-400);
}

/* ========================================
   Scrollbar discrète (mobile-friendly)
   ======================================== */

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ========================================
   Utilitaires
   ======================================== */

.transition-colors {
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, opacity 0.15s;
}

.transition-transform {
    transition: transform 0.12s, opacity 0.12s;
}

.hover-lift:hover {
    transform: translateY(-1px);
    opacity: 0.93;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 184, 0, 0.5); }
    50% { box-shadow: 0 0 0 12px rgba(245, 184, 0, 0); }
}

.animate-pulse-gold {
    animation: pulse-gold 2s infinite;
}