/* ============================================
   BADGES NUMÉRIQUES - Charte graphique
   Plateforme de badges numériques
   ============================================ */

/* --- Variables CSS --- */
:root {
    --color-primary: #33307A;       /* Bleu indigo */
    --color-primary-dark: #272463;
    --color-primary-light: #4A46A0;
    --color-pink: #F06B8A;          /* Rose */
    --color-pink-dark: #D94D70;
    --color-orange: #F07000;        /* Orange */
    --color-orange-dark: #CC5F00;
    --color-secondary: #33307A;     /* = primary pour cohérence titres */
    --color-accent: #F07000;
    --color-text: #2D2D2D;
    --color-text-light: #5A5A5A;
    --color-bg: #FFFFFF;
    --color-bg-light: #F7F6FB;      /* Léger ton indigo */
    --color-bg-warm: #FFF5F7;       /* Léger ton rose */
    --color-border: #E4E2F0;
    --color-success: #28A745;
    --color-error: #DC3545;
    --font-main: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(51,48,122,0.06);
    --shadow-md: 0 4px 20px rgba(51,48,122,0.10);
    --shadow-lg: 0 8px 30px rgba(51,48,122,0.15);
    --max-width: 1200px;
    --transition: 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-pink);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-pink-dark);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- BARRE ORANGE (top) --- */
.top-bar {
    background: var(--color-primary);
    color: white;
    padding: 10px 0;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

.top-bar a {
    color: white;
    text-decoration: underline;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* --- HEADER / NAVIGATION BLANC CASSÉ --- */
.site-header {
    background: #FFFDF5;
    color: var(--color-primary);
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo img {
    height: 48px;
    width: auto;
}

.header-logo .site-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.header-logo .site-name span {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
    letter-spacing: 0;
    color: var(--color-text-light);
}

/* --- NAVIGATION --- */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    color: var(--color-primary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--color-pink);
    color: white;
}

/* Mobile menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* --- HERO SECTION --- */
.hero {
    background: var(--color-primary);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-pink);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-align: center;
    justify-content: center;
    min-width: 180px;
}

.btn-primary {
    background: white;
    color: var(--color-primary);
    border-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: var(--color-pink);
    color: white;
    border-color: var(--color-pink);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255,255,255,0.6);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: white;
    color: white;
    transform: translateY(-2px);
}

.btn-action {
    background: var(--color-pink);
    color: white;
    border-color: var(--color-pink);
}

.btn-action:hover {
    background: var(--color-pink-dark);
    border-color: var(--color-pink-dark);
    transform: translateY(-2px);
}

.btn-red,
a.btn-red,
a.btn-red:visited,
a.btn-red:active {
    background: var(--color-orange);
    color: white;
    border-color: var(--color-orange);
}

.btn-red:hover,
a.btn-red:hover {
    background: var(--color-orange-dark);
    border-color: var(--color-orange-dark);
    color: white;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51,48,122,0.2);
}

.btn-icon {
    font-size: 1.2em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* --- SECTIONS --- */
.section {
    padding: 60px 0;
}

.section-light {
    background: var(--color-bg-light);
}

.section-warm {
    background: var(--color-bg-warm);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-orange);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- CARDS --- */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-pink);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* --- FORMS --- */
.form-container {
    max-width: 560px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--color-secondary);
    font-size: 0.95rem;
}

.form-group label small {
    color: var(--color-text-light);
    font-weight: 400;
}

.form-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--color-bg-light);
}

.form-field:focus {
    outline: none;
    border-color: var(--color-pink);
    box-shadow: 0 0 0 3px rgba(240, 107, 138, 0.15);
    background: white;
}

textarea.form-field {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-info {
    background: #E7F3FF;
    border: 1px solid #0066CC;
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #004499;
    margin: 16px 0;
}

.form-consent {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 20px 0;
}

.form-consent label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-consent input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.form-actions {
    text-align: center;
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- BADGE CARDS --- */
.badge-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.badge-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-pink);
}

.badge-card + .badge-card {
    margin-top: 16px;
}

.badge-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.badge-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-bg-light), var(--color-bg-warm));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.badge-info {
    flex: 1;
}

.badge-info h3 {
    margin: 0 0 8px;
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.badge-info p, .badge-info small {
    color: var(--color-text-light);
    margin: 4px 0;
}

.badge-status {
    color: var(--color-success);
    font-weight: 600;
}

.description-full {
    display: none;
    margin-top: 8px;
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.description-full.visible {
    display: block;
}

.description-toggle {
    background: none;
    border: none;
    color: var(--color-pink);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 0;
    font-weight: 500;
}

.description-toggle:hover {
    text-decoration: underline;
}

.badge-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-actions .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    min-width: auto;
}

/* --- ACCORDION (RGPD) --- */
.accordion-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-sm);
}

.accordion-header {
    width: 100%;
    padding: 16px 20px;
    background: var(--color-bg-light);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background var(--transition);
    text-align: left;
}

.accordion-header:hover {
    background: #EEECF7;
    border-left: 3px solid var(--color-pink);
}

.accordion-icon {
    font-size: 0.8rem;
    transition: transform var(--transition);
}

.accordion-item.open .accordion-icon {
    transform: rotate(90deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 20px;
}

.accordion-item.open .accordion-content {
    max-height: 2000px;
    padding: 20px;
}

/* --- MESSAGES --- */
.message {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 0.95rem;
}

.message-success {
    background: #E8F5E9;
    border: 1px solid var(--color-success);
    color: #1B5E20;
}

.message-error {
    background: #FFEBEE;
    border: 1px solid var(--color-error);
    color: #B71C1C;
}

.message-info {
    background: #E3F2FD;
    border: 1px solid #1976D2;
    color: #0D47A1;
}

/* --- LOADING SPINNER --- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- FOOTER --- */
.site-footer {
    background: var(--color-primary);
    color: white;
    padding: 40px 0 24px;
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.7);
}

.footer-col a {
    color: rgba(255,255,255,0.85);
    display: block;
    padding: 4px 0;
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* --- INFO SECTION --- */
.info-section {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.info-section p {
    font-size: 1.05rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* --- SEARCH BAR --- */
.search-bar {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto 32px;
}

.search-bar .form-field {
    flex: 1;
}

.search-bar .btn {
    min-width: auto;
    padding: 12px 24px;
}

/* --- RESULTS AREA --- */
.results-area {
    max-width: 700px;
    margin: 0 auto;
}

.results-count {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero {
        padding: 48px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .header-inner {
        flex-wrap: wrap;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 4px;
    }
    
    .main-nav.open {
        display: flex;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 24px;
    }
    
    .badge-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .badge-actions {
        justify-content: center;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* --- BANDEAU RGPD --- */
.rgpd-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-primary);
    color: white;
    padding: 20px 24px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    transform: translateY(0);
    transition: transform 0.4s ease;
}

.rgpd-banner.hidden {
    transform: translateY(100%);
    pointer-events: none;
}

.rgpd-banner-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.rgpd-banner-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
    min-width: 250px;
}

.rgpd-banner-text a {
    color: var(--color-pink);
    text-decoration: underline;
}

.rgpd-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.rgpd-banner-actions .btn {
    padding: 10px 20px;
    font-size: 0.85rem;
    min-width: auto;
}

.btn-accept {
    background: var(--color-success);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition);
}

.btn-accept:hover {
    background: #218838;
}

@media (max-width: 600px) {
    .rgpd-banner-inner {
        flex-direction: column;
        text-align: center;
    }
    .rgpd-banner-actions {
        width: 100%;
        justify-content: center;
    }
}
