:root {
    --bg-color: #fafafa; --text-primary: #111827; --text-secondary: #4b5563;
    --accent-1: #4f46e5; --accent-2: #ec4899; --accent-hover: #4338ca;
    --card-bg: #ffffff; --border-color: #e5e7eb; --success: #10b981;
}

html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-primary); overflow-x: hidden; }
h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }
.gradient-text { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* HEADER & LANG */
.main-header { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.header-container { max-width: 1200px; margin: 0 auto; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; font-weight: 800; cursor: pointer;}
.desktop-nav a { color: var(--text-secondary); text-decoration: none; margin: 0 1rem; font-weight: 500; font-size: 0.95rem; transition: color 0.2s;}
.desktop-nav a:hover { color: var(--accent-1); }

.header-actions { display: flex; align-items: center; gap: 1rem; }
.lang-selector { position: relative; }
.lang-btn { background: transparent; border: 1px solid var(--border-color); padding: 0.5rem 0.8rem; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.lang-dropdown { position: absolute; top: 100%; right: 0; margin-top: 0.5rem; background: white; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); overflow: hidden; z-index: 200; width: 140px;}
.lang-option { width: 100%; text-align: left; padding: 0.8rem 1rem; background: transparent; border: none; cursor: pointer; font-weight: 500; border-bottom: 1px solid #f3f4f6;}
.lang-option:hover { background: #f9fafb; color: var(--accent-1); }

/* BUTTONS & FORMS */
.primary-btn { background: var(--accent-1); color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: 'Inter'; font-size: 0.95rem;}
.primary-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.secondary-btn { background: white; color: var(--text-primary); border: 1px solid var(--border-color); padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.secondary-btn:hover { background: #f9fafb; }
.premium-btn { background: #111827; color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.premium-btn:hover { background: #000; }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; border-color: var(--accent-2); color: var(--accent-2); }
.btn-small:hover { background: rgba(236, 72, 153, 0.1); }
.w-full { width: 100%; } .mt-2 { margin-top: 1rem; } .mb-2 { margin-bottom: 1rem; }

/* VIEWS & HERO */
.view-section { display: none; animation: fadeIn 0.4s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hero { max-width: 1200px; margin: 4rem auto; padding: 0 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.badge-hero { background: rgba(79, 70, 229, 0.1); color: var(--accent-1); padding: 0.4rem 0.8rem; border-radius: 20px; font-weight: 600; font-size: 0.85rem; display: inline-block; margin-bottom: 1rem; }
.hero-title { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; font-weight: 800; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.6; }
.pulse-btn { font-size: 1.1rem; padding: 1rem 2rem; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }

.hero-visual { position: relative; height: 400px; background: url('https://www.transparenttextures.com/patterns/cubes.png'); border-radius: 24px; }
.floating-qr { position: absolute; width: 120px; height: 120px; background: white; border-radius: 16px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); border: 4px solid white;}
.qr-1 { top: 10%; left: 10%; background: linear-gradient(45deg, #000 50%, #fff 50%); animation: float 6s ease-in-out infinite;}
.qr-2 { top: 40%; right: 10%; background: linear-gradient(-45deg, var(--accent-1) 50%, #fff 50%); animation: float 5s ease-in-out infinite reverse;}
.qr-3 { bottom: 10%; left: 30%; background: linear-gradient(180deg, var(--accent-2) 50%, #fff 50%); animation: float 7s ease-in-out infinite;}
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-20px); } 100% { transform: translateY(0px); } }

.features-section { max-width: 1200px; margin: 5rem auto; padding: 0 2rem; text-align: center; }
.section-title { font-size: 2.5rem; margin-bottom: 3rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.feature-card { background: white; padding: 2.5rem 2rem; border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid var(--border-color); }
.feature-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* FUNNEL */
.funnel-container { max-width: 1100px; margin: 2rem auto 5rem; background: white; border-radius: 24px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05); border: 1px solid var(--border-color); overflow: hidden; }
.funnel-progress { display: flex; justify-content: space-between; padding: 1.5rem 2rem; background: #f9fafb; border-bottom: 1px solid var(--border-color); position: relative; }
.step-indicator { font-size: 0.85rem; font-weight: 600; color: #9ca3af; z-index: 2; position: relative; }
.step-indicator.active { color: var(--accent-1); }
.progress-line { position: absolute; bottom: 0; left: 0; height: 3px; background: #e5e7eb; width: 100%; }
.progress-fill { height: 100%; background: var(--accent-1); width: 25%; transition: width 0.3s ease; }

.funnel-steps-wrapper { padding: 3rem; min-height: 400px; }
.funnel-step { display: none; animation: fadeIn 0.3s ease; }
.funnel-step.active { display: block; }
.funnel-step.hidden { display: none !important; }
.back-btn { background: none; border: none; color: var(--text-secondary); font-weight: 600; cursor: pointer; margin-bottom: 1.5rem; font-size: 0.9rem; }

.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem;}
.type-card { background: white; border: 2px solid var(--border-color); padding: 1.5rem 1rem; border-radius: 12px; font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 1rem; color: var(--text-primary); }
.type-card:hover { border-color: var(--accent-1); box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1); }

.form-container { margin-bottom: 2rem; margin-top:1.5rem;}
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.form-group input, .custom-select { width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-family: inherit; margin-bottom: 1rem; transition: border 0.2s; background:white; color:var(--text-primary);}
.form-group input:focus, .custom-select:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.step-actions { display: flex; justify-content: flex-end; margin-top: 2rem; }

/* DESIGN FREEMIUM */
.design-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }

.freemium-section { border: 1px solid var(--border-color); padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; position: relative; }
.pro-section { border-color: var(--accent-2); background: rgba(236, 72, 153, 0.02); }
.pro-badge { position: absolute; top: -10px; right: 20px; background: var(--accent-2); color: white; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 700; }
.freemium-title { font-size: 1.1rem; margin-bottom: 1.5rem; font-family: 'Inter'; font-weight: 700; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }

.control-group { margin-bottom: 1.2rem; }
.control-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }

/* FIX V10 : Text Overflow and flexbox adjustments */
.box-fluid { flex: 1; min-width: 0; } /* allows children to shrink and not overflow */
.nowrap-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; padding-right: 2rem; }

input[type="color"] { -webkit-appearance: none; border: none; width: 100%; height: 40px; border-radius: 8px; cursor: pointer; background: transparent; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border-color); border-radius: 8px; }

.file-upload { border: 2px dashed var(--border-color); border-radius: 8px; padding: 1rem; text-align: center; position: relative; cursor: pointer; background: #f9fafb; transition: all 0.2s;}
.file-upload.small { padding: 0.5rem; }
.file-upload:hover { border-color: var(--accent-1); }
.file-upload input { position: absolute; top:0; left:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.file-upload p { font-size: 0.85rem; color: var(--text-secondary); pointer-events: none; margin:0; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}

/* GRAPHIC FRAMES BUTTONS */
.frame-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 1rem;}
.frame-btn { background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 0.5rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s;}
.frame-btn.active, .frame-btn:hover { border-color: var(--accent-2); color: var(--accent-2); background: rgba(236, 72, 153, 0.05);}

/* PREVIEW & GRAPHIC FRAMES SVGs - V10 CORRECTION */
.design-preview { background: #f9fafb; border-radius: 16px; padding: 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border-color); }

/* The container that will change shape based on the graphic frame chosen */
.graphic-frame-container { 
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    transition: all 0.3s ease; 
    background-size: contain; background-repeat: no-repeat; background-position: center top;
}

/* Base style (No Frame) */
.graphic-frame-container.frame-none { width: 200px; height: 200px; background: white; padding: 0; border-radius: 16px; }

/* Le Canvas est géré en absolu. Sa taille est calculée par le JS pour s'insérer pile-poil. */
.qr-canvas-wrapper { position: absolute; display: flex; justify-content: center; align-items: center; transform-origin: top center; transition: all 0.3s ease;}

/* Mode 'Aucun' cadre */
.frame-none .qr-canvas-wrapper { position: relative; }

/* SVG Frame 1 : Coffee Cup */
.graphic-frame-container.frame-coffee {
    width: 250px; height: 250px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M10,30 Q50,90 90,30 Z" fill="%23fff" stroke="%23000" stroke-width="2"/><path d="M90,40 C100,40 100,60 90,60" fill="none" stroke="%23000" stroke-width="2"/><path d="M30,25 Q40,10 50,25 Q60,40 70,25" fill="none" stroke="%234b5563" stroke-width="1.5"/></svg>');
}
/* on décale le mini-canvas généré par JS dans la tasse */
.frame-coffee .qr-canvas-wrapper { top: 90px; }

/* SVG Frame 2 : Smartphone */
.graphic-frame-container.frame-phone {
    width: 180px; height: 350px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 200" xmlns="http://www.w3.org/2000/svg"><rect x="10" y="10" width="80" height="180" rx="10" fill="%23fff" stroke="%23111827" stroke-width="3"/><rect x="40" y="20" width="20" height="2" rx="1" fill="%23111827"/></svg>');
}
/* on décale le mini-canvas dans l'écran */
.frame-phone .qr-canvas-wrapper { top: 50px; }

/* SVG Frame 3 : Polaroid */
.graphic-frame-container.frame-polaroid {
    width: 200px; height: 250px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 120" xmlns="http://www.w3.org/2000/svg"><rect x="5" y="5" width="90" height="110" fill="%23fff" stroke="%23e5e7eb" stroke-width="2" filter="drop-shadow(2px 4px 6px rgba(0,0,0,0.1))"/><rect x="10" y="10" width="80" height="80" fill="%23f3f4f6"/></svg>');
}
.frame-polaroid .qr-canvas-wrapper { top: 25px; }


.frame-text { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.2rem; text-align: center; letter-spacing: 2px; color: var(--text-primary); position: absolute; z-index: 10;}

/* Positionnement du texte SCAN ME (bien sous le QR Code) */
.graphic-frame-container.frame-none .frame-text { display: none !important; }
.graphic-frame-container.frame-coffee .frame-text { bottom: 10px; color: #111827; }
.graphic-frame-container.frame-phone .frame-text { bottom: 60px; font-size:1rem; }
.graphic-frame-container.frame-polaroid .frame-text { bottom: 25px; font-family: 'Caveat', cursive; font-size: 1.5rem;}

/* UPSELL */
.success-header { text-align: center; margin-bottom: 2rem; }
.upsell-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.upsell-card { border: 2px solid var(--border-color); border-radius: 16px; padding: 1.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; background: white;}
.upsell-card h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.upsell-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.upsell-card .price { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 1.5rem; }

/* Thumbnail preview for Upsell */
.qr-thumbnail-wrapper { width:120px; height:120px; background: transparent; margin-bottom: 1rem; display: flex; justify-content: center; align-items: center;} 
/* When cloning the graphic frame, we scale the whole thing down */
.qr-thumbnail-wrapper .graphic-frame-container { transform: scale(0.5); transform-origin: center; }

.premium-card { border-color: #111827; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transform: scale(1.02); z-index: 10; }
.badge-best { position: absolute; top: -12px; background: var(--success); color: white; padding: 0.2rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; white-space: nowrap;}
.mockup-img { width: 100px; height: 100px; background-color: #e5e7eb; border-radius: 8px; margin-bottom: 1rem; }
.sticker-mockup { background: linear-gradient(135deg, #fca5a5, #f87171); }
.tent-mockup { background: linear-gradient(135deg, #d4d4d8, #a1a1aa); }

/* V12 : ACCORDIONS & PALETTES */
.design-accordion { border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 1rem; background: white; overflow: hidden; transition: all 0.3s; }
.design-accordion[open] { border-color: var(--accent-1); box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1); }
.design-accordion.pro-accordion[open] { border-color: var(--accent-2); background: rgba(236, 72, 153, 0.02); }
.design-accordion summary { padding: 1rem 1.5rem; font-weight: 700; font-family: 'Inter'; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5rem; user-select: none; }
.design-accordion summary::-webkit-details-marker { display: none; }
.design-accordion summary::after { content: '▼'; margin-left: auto; font-size: 0.8rem; color: var(--text-secondary); transition: transform 0.3s; }
.design-accordion[open] summary::after { transform: rotate(180deg); color: var(--accent-1); }
.design-accordion.pro-accordion[open] summary::after { color: var(--accent-2); }
.accordion-content { padding: 0 1.5rem 1.5rem; border-top: 1px solid var(--border-color); margin-top: 0.5rem; padding-top: 1rem; }
.design-accordion[open] .accordion-content { animation: slideDown 0.3s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.palettes-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.palette-btn { height: 35px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; transition: transform 0.2s; }
.palette-btn:hover { transform: scale(1.05); }
.palette-btn:focus { outline: none; border-color: var(--accent-1); }
