/* =========================================================
   Cartéo — design system
   Thème clair par défaut, thème sombre via [data-theme="dark"]
   ========================================================= */
:root {
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;

    --bg: #f6f6fb;
    --bg-soft: #eef0f8;
    --surface: #ffffff;
    --surface-2: #f4f5fa;
    --text: #0f1222;
    --muted: #61678a;
    --faint: #9aa0b8;
    --border: #e6e8f1;
    --border-strong: #d2d6e5;

    --primary: #6355ff;
    --primary-hover: #4f40f2;
    --primary-soft: #efedff;
    --primary-text: #4b3df0;
    --grad: linear-gradient(120deg, #6355ff 0%, #b44dff 48%, #ff6b8b 100%);
    --danger: #e11d48;

    --success-bg: #ecfdf5; --success-text: #047857; --success-border: #a7f3d0;
    --error-bg: #fff1f3;   --error-text: #be123c;   --error-border: #fecdd6;

    --ring: 0 0 0 4px rgba(99, 85, 255, .18);
    --shadow-sm: 0 1px 2px rgba(15, 18, 34, .06);
    --shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 12px 32px -14px rgba(15, 18, 34, .2);
    --shadow-lg: 0 50px 100px -40px rgba(30, 20, 90, .45);
    --header-bg: rgba(246, 246, 251, .72);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0a0b12;
    --bg-soft: #10121c;
    --surface: #141623;
    --surface-2: #1a1d2d;
    --text: #eef0fa;
    --muted: #9ba0bd;
    --faint: #6b7090;
    --border: #23273a;
    --border-strong: #31364e;

    --primary: #7b6fff;
    --primary-hover: #9086ff;
    --primary-soft: rgba(123, 111, 255, .14);
    --primary-text: #b4acff;

    --success-bg: rgba(16, 185, 129, .1); --success-text: #6ee7b7; --success-border: rgba(16, 185, 129, .3);
    --error-bg: rgba(225, 29, 72, .1);    --error-text: #fda4af;   --error-border: rgba(225, 29, 72, .35);

    --ring: 0 0 0 4px rgba(123, 111, 255, .28);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    --shadow-lg: 0 50px 100px -40px rgba(0, 0, 0, .8);
    --header-bg: rgba(10, 11, 18, .7);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased; transition: background-color .25s, color .25s;
}
main { flex: 1; }
a { color: var(--primary-text); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.025em; font-weight: 700; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
::selection { background: rgba(99, 85, 255, .25); }
.muted { color: var(--muted); }
.inline { display: inline; margin: 0; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--header-bg); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.28rem; letter-spacing: -.03em; color: var(--text); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); position: relative; box-shadow: 0 6px 16px -6px rgba(99, 85, 255, .7); }
.brand-mark::after { content: ''; position: absolute; inset: 10px 7px; border: 2.5px solid #fff; border-radius: 3px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: 10px; transition: color .15s, background .15s; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); }
.theme-toggle { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: border-color .15s, transform .2s var(--ease); }
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle:active { transform: rotate(20deg) scale(.95); }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .85rem; font-weight: 600; }
.user-chip .logout-btn { width: 30px; height: 30px; border-radius: 50%; }

.footer { color: var(--muted); font-size: .85rem; padding: 32px 0; margin-top: 80px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer .brand { font-size: 1rem; }
.footer .brand-mark { width: 22px; height: 22px; border-radius: 7px; }
.footer .brand-mark::after { inset: 7px 5px; border-width: 2px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
    border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2;
    cursor: pointer; text-decoration: none; white-space: nowrap; position: relative;
    transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .12s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 20px -8px rgba(99, 85, 255, .8); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 12px 26px -8px rgba(99, 85, 255, .9); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { opacity: .9; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--error-border); background: var(--error-bg); }
.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 11px; display: grid; place-items: center; cursor: pointer; font: inherit; transition: color .15s, border-color .15s, background .15s; }
.icon-btn:hover { color: var(--danger); border-color: var(--error-border); background: var(--error-bg); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Messages ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; margin: 20px 0; font-weight: 500; font-size: .92rem; word-break: break-word; border: 1px solid; animation: slide-down .35s var(--ease); }
.flash::before { content: ''; flex: 0 0 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: currentColor; }
.flash-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.flash-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-border); }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; margin: 0; min-width: 0; }
.field > span { font-weight: 600; font-size: .85rem; display: flex; justify-content: space-between; color: var(--text); }
.field input, .field textarea, .slug-input, .link-row input {
    width: 100%; font: inherit; font-size: .93rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder, .field textarea::placeholder, .link-row input::placeholder { color: var(--faint); }
.field input:hover, .field textarea:hover, .link-row input:hover { border-color: var(--border-strong); }
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus, .slug-input:focus-within, .link-row input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.field input[type=file] { padding: 8px; font-size: .85rem; }
.hint { color: var(--muted); font-size: .8rem; margin: 0; }
.counter { font-style: normal; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 7px; font-size: .85rem; margin-top: 6px; cursor: pointer; color: var(--muted); }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slug-input { display: flex; align-items: center; padding: 0; overflow: hidden; }
.slug-prefix { padding: 10px 0 10px 13px; color: var(--faint); white-space: nowrap; font-size: .88rem; max-width: 55%; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.slug-input input { border: 0 !important; box-shadow: none !important; padding-left: 2px; min-width: 0; background: transparent; }

/* ---------- Authentification ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 68px); }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; animation: fade-up .5s var(--ease); }
.auth-card h1 { margin: 0 0 6px; font-size: 2.1rem; }
.auth-card > .muted { margin: 0 0 28px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .9rem; margin: 24px 0 0; }
.auth-switch a { font-weight: 600; }
.auth-aside { position: relative; overflow: hidden; margin: 16px 16px 16px 0; border-radius: 28px; background: #0d0b24; display: grid; place-items: center; padding: 40px; isolation: isolate; }
.auth-aside .aurora { opacity: .9; }
.auth-aside-content { position: relative; display: grid; gap: 28px; justify-items: center; max-width: 380px; text-align: center; color: #fff; }
.auth-aside-content blockquote { margin: 0; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; }
.auth-aside-content cite { display: block; margin-top: 10px; font-family: var(--font); font-style: normal; font-size: .85rem; font-weight: 500; color: rgba(255, 255, 255, .65); letter-spacing: 0; }
.auth-aside .phone { max-width: 300px; transform: rotate(-3deg); }

/* ---------- Fond « aurore » animé ---------- */
.aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 520px; height: 520px; background: #6355ff; top: -160px; left: -120px; }
.aurora span:nth-child(2) { width: 460px; height: 460px; background: #c04dff; top: -60px; right: -140px; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 420px; height: 420px; background: #ff6b8b; bottom: -220px; left: 30%; animation-delay: -12s; opacity: .35; }
[data-theme="dark"] .aurora span { opacity: .35; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }

/* ---------- Accueil ---------- */
.hero-wrap { position: relative; isolation: isolate; overflow: hidden; }
.hero-wrap .aurora span { opacity: .28; }
[data-theme="dark"] .hero-wrap .aurora span { opacity: .22; }
.hero-wrap::after { content: ''; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%); opacity: .6; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .8rem; padding: 5px 12px 5px 5px; border-radius: 999px; box-shadow: var(--shadow-sm); text-decoration: none; }
.pill b { background: var(--grad); color: #fff; padding: 2px 9px; border-radius: 999px; font-size: .72rem; }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.6rem); margin: 22px 0 20px; font-weight: 800; letter-spacing: -.045em; line-height: 1.02; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 540px; margin: 0; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; color: var(--muted); font-size: .86rem; font-weight: 500; }
.hero-proof span { display: inline-flex; align-items: center; gap: 6px; }
.hero-proof svg { width: 16px; height: 16px; color: #10b981; }
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-visual .phone { animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }
.float-chip { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .82); color: #0f1222; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 20px 40px -18px rgba(30, 20, 90, .45); font-size: .82rem; font-weight: 600; animation: float 6s ease-in-out infinite; }
[data-theme="dark"] .float-chip { background: rgba(20, 22, 35, .78); color: #eef0fa; border-color: rgba(255, 255, 255, .08); }
.float-chip small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.float-chip .chip-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.float-chip .chip-ico svg { width: 17px; height: 17px; }
.chip-1 { top: 34%; left: -10%; animation-delay: -2s; }
.chip-1 .chip-ico { background: #10b981; }
.chip-2 { bottom: 18%; right: -8%; animation-delay: -4s; }
.chip-2 .chip-ico { background: var(--grad); }

.section { padding: 88px 0 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary-text); margin-bottom: 12px; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); margin: 0 0 14px; letter-spacing: -.04em; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.stats-strip div { padding: 24px; text-align: center; }
.stats-strip div + div { border-left: 1px solid var(--border); }
.stats-strip strong { display: block; font-family: var(--font-display); font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; }
.stats-strip span { color: var(--muted); font-size: .86rem; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile { position: relative; overflow: hidden; grid-column: span 2; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.tile.wide { grid-column: span 3; }
.tile h3 { margin: 18px 0 8px; font-size: 1.2rem; }
.tile p { margin: 0; color: var(--muted); font-size: .93rem; }
.tile-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.tile-ico svg { width: 22px; height: 22px; }
.tile.featured { background: #0d0b24; color: #fff; border-color: transparent; isolation: isolate; }
.tile.featured p { color: rgba(255, 255, 255, .72); }
.tile.featured .tile-ico { background: rgba(255, 255, 255, .12); color: #fff; }
.tile.featured .aurora span { opacity: .5; filter: blur(60px); }
.tile-visual { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.tile-visual i { font-style: normal; font-size: .78rem; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tile.featured .tile-visual i { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .14); color: #fff; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-bottom: 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step h3 { margin: 0 0 6px; font-size: 1.15rem; }
.step p { margin: 0; color: var(--muted); font-size: .93rem; }

.themes-show { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: start; }
.theme-sample { display: grid; gap: 10px; justify-items: center; text-align: center; }
.theme-sample .sample-frame { container-type: inline-size; width: 100%; height: 330px; border-radius: 22px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); position: relative; transition: transform .3s var(--ease), box-shadow .3s; }
.theme-sample:hover .sample-frame { transform: translateY(-6px); box-shadow: var(--shadow); }
.theme-sample .sample-frame .vcard { position: absolute; top: 0; left: 0; width: calc(100cqw / .56); max-width: none; transform: scale(.56); transform-origin: top left; border-radius: 0; box-shadow: none; }
.theme-sample strong { font-size: .92rem; }

.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0 20px; transition: border-color .2s; }
.faq details[open] { border-color: var(--border-strong); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); }

.cta-band { position: relative; isolation: isolate; overflow: hidden; margin-top: 96px; padding: 64px 32px; border-radius: 32px; text-align: center; background: #0d0b24; color: #fff; }
.cta-band h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 12px; letter-spacing: -.04em; }
.cta-band p { color: rgba(255, 255, 255, .72); margin: 0 auto 28px; max-width: 520px; font-size: 1.05rem; }
.cta-band .btn-primary { background: #fff; color: #0d0b24; box-shadow: 0 16px 40px -12px rgba(255, 255, 255, .4); }
.cta-band .btn-primary:hover { background: #f1efff; }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Maquette de téléphone ---------- */
.phone { position: relative; width: 100%; max-width: 380px; border-radius: 46px; padding: 11px; background: linear-gradient(145deg, #2a2d42, #0c0d16); box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, var(--shadow-lg); }
.phone::before { content: ''; position: absolute; top: 20px; left: 50%; z-index: 3; width: 92px; height: 24px; margin-left: -46px; border-radius: 999px; background: #05060b; }
.phone-screen { border-radius: 36px; overflow: hidden; background: #eef0f7; max-height: 720px; overflow-y: auto; scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-screen .vcard { max-width: none; border-radius: 0; box-shadow: none; min-height: 100%; }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 40px 0 12px; }
.page-head h1 { margin: 6px 0 4px; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.page-head .muted { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .86rem; }
.back:hover { color: var(--primary-text); }

/* ---------- Tableau de bord ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .84rem; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; margin-top: 24px; }
.dash-item { --accent: var(--primary); --on-accent: #fff; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; animation: fade-up .5s var(--ease) both; }
.dash-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.dash-cover { height: 84px; background: radial-gradient(circle at 85% 0%, rgba(255, 255, 255, .35), transparent 50%), linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); background-size: cover; background-position: center; }
.dash-content { padding: 0 20px 18px; display: grid; gap: 14px; }
.dash-top { display: flex; align-items: flex-start; gap: 14px; margin-top: -32px; }
.dash-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; overflow: hidden; flex-shrink: 0; border: 4px solid var(--surface); }
.dash-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-info { min-width: 0; padding-top: 38px; }
.dash-info h3 { margin: 0; font-size: 1.12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-info p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-link { display: flex; align-items: center; gap: 8px; width: 100%; font: inherit; font-size: .84rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 9px 12px; cursor: pointer; text-align: left; transition: color .15s, border-color .15s; }
.dash-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dash-link::after { content: 'Copier'; font-size: .74rem; font-weight: 600; color: var(--primary-text); }
.dash-link:hover { border-color: var(--primary); color: var(--text); }
.dash-link svg { width: 15px; height: 15px; }
.dash-stats { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.dash-stats span { display: inline-flex; align-items: center; gap: 5px; }
.dash-stats svg { width: 14px; height: 14px; }
.dash-actions { display: flex; gap: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.dash-actions .btn { padding-left: 10px; padding-right: 10px; }
.dash-actions .btn-text { flex: 1; min-width: 0; }
.dash-actions .btn-text span { overflow: hidden; text-overflow: ellipsis; }
/* Suppression : petit bouton discret sur la bannière */
.dash-delete { position: absolute; top: 10px; right: 10px; z-index: 1; margin: 0; }
.dash-delete button { width: 34px; height: 34px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(10, 11, 20, .32); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: .85; transition: background .15s, opacity .15s; }
.dash-delete button svg { width: 16px; height: 16px; }
.dash-delete button:hover { opacity: 1; background: var(--danger); border-color: var(--danger); }
.dash-new { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 280px; border: 2px dashed var(--border-strong); border-radius: 22px; color: var(--muted); text-decoration: none; font-weight: 600; transition: border-color .2s, color .2s, background .2s; }
.dash-new:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.dash-new span { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }

.empty { text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 56px 24px; margin-top: 24px; }
.empty h1, .empty h2 { margin: 16px 0 8px; }
.empty .btn { margin-top: 18px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.empty-icon svg { width: 30px; height: 30px; }
section.empty { max-width: 560px; margin-top: 64px; }

/* ---------- Éditeur ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 40px; align-items: start; margin-top: 16px; }
.editor-form { gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px 24px 24px; margin: 0; display: grid; gap: 14px; min-width: 0; box-shadow: var(--shadow-sm); transition: border-color .2s; }
.panel:focus-within { border-color: var(--border-strong); }
.panel legend, .panel h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: -.02em; padding: 0; float: left; width: 100%; margin: 0 0 2px; }
.editor-preview { position: sticky; top: 92px; display: grid; justify-items: center; gap: 14px; }
.preview-label { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.preview-label::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.editor-preview .phone-screen { max-height: calc(100vh - 180px); }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 12px; z-index: 5; padding: 10px; margin-top: 4px; border-radius: 18px; background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); box-shadow: var(--shadow); }

.avatar-field { display: flex; align-items: center; gap: 16px; }
.avatar-thumb { width: 76px; height: 76px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.4rem; overflow: hidden; flex-shrink: 0; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
.avatar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.theme-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.theme-opt { display: grid; gap: 6px; justify-items: center; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt input:checked ~ span:last-child { color: var(--text); }
.theme-swatch { width: 100%; height: 62px; border-radius: 13px; border: 2px solid var(--border); background: #fff; position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .2s var(--ease); }
.theme-opt:hover .theme-swatch { transform: translateY(-2px); }
.theme-opt input:checked + .theme-swatch { border-color: var(--primary); box-shadow: var(--ring); }
.theme-opt input:focus-visible + .theme-swatch { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-swatch::before { content: ''; position: absolute; left: 50%; top: 18px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.theme-swatch::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 10px; height: 5px; border-radius: 3px; background: #dfe2ee; }
.theme-swatch-classic { background: linear-gradient(var(--primary) 0 26px, #fff 26px); }
.theme-swatch-minimal { background: linear-gradient(var(--primary) 0 4px, #fff 4px); }
.theme-swatch-dark { background: linear-gradient(var(--primary) 0 26px, #111827 26px); }
.theme-swatch-dark::before { border-color: #111827; }
.theme-swatch-dark::after { background: #374151; }
.theme-swatch-gradient { background: linear-gradient(160deg, var(--primary), #2a2a8a); }
.theme-swatch-gradient::before, .theme-swatch-aurora::before { background: rgba(255, 255, 255, .5); }
.theme-swatch-gradient::after, .theme-swatch-aurora::after { background: rgba(255, 255, 255, .3); }
.theme-swatch-aurora { background: radial-gradient(circle at 15% 10%, #6355ff, transparent 55%), radial-gradient(circle at 90% 30%, #ff6b8b, transparent 50%), #0d0b24; }

.color-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; transition: transform .15s var(--ease), box-shadow .15s; }
.swatch:hover { transform: scale(1.1); }
.swatch.active { box-shadow: 0 0 0 2px var(--text); }
[data-theme="dark"] .swatch:not(.active) { box-shadow: 0 0 0 1px var(--border-strong); }
.color-picker input[type=color] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }

.cover-field { display: grid; gap: 8px; }
.cover-thumb { height: 96px; border-radius: 14px; border: 1px dashed var(--border-strong); background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--faint); font-size: .85rem; }
.cover-thumb.has-image { border-style: solid; }
.cover-thumb.has-image span { display: none; }
.cover-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cover-actions .check { margin: 0; }

.links-editor { display: grid; gap: 10px; }
.link-row { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 8px; }
.link-row input { padding: 9px 12px; }
#add-link[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Portfolio (gestion) ---------- */
.pf-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 16px; }
.pf-add { position: sticky; top: 92px; }
.pf-drop { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border: 2px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.pf-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.pf-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pf-drop-empty { display: grid; justify-items: center; gap: 4px; color: var(--muted); text-align: center; pointer-events: none; }
.pf-drop-empty svg { width: 30px; height: 30px; color: var(--primary-text); }
.pf-drop-empty strong { color: var(--text); font-size: .92rem; }
.pf-drop-empty small { font-size: .78rem; }
.pf-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pf-drop.has-image .pf-drop-empty { display: none; }
.pf-list { display: grid; gap: 12px; }
.pf-list .empty { margin-top: 0; }
.pf-item { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px; scroll-margin-top: 92px; transition: border-color .2s, box-shadow .2s; }
.pf-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.pf-thumb { width: 100px; height: 100px; border-radius: 13px; object-fit: cover; background: var(--surface-2); }
.pf-body details > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding-top: 4px; }
.pf-body details > summary::-webkit-details-marker { display: none; }
.pf-title { font-weight: 700; }
.pf-desc { color: var(--muted); font-size: .87rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pf-edit-btn { justify-self: start; margin-top: 8px; }
.pf-body details[open] .pf-edit-btn { display: none; }
.pf-edit { margin-top: 14px; gap: 12px; }
.pf-tools { display: flex; flex-direction: column; gap: 6px; }
.pf-tools .icon-btn { height: 34px; width: 34px; font-size: 1rem; }
.pf-tools .icon-btn:not(:has(svg)):hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.pf-tools .icon-btn[disabled] { opacity: .35; cursor: default; pointer-events: none; }

/* ---------- Page publique ---------- */
.public-page { --accent: var(--primary); position: relative; isolation: isolate; }
.public-page .aurora span:nth-child(1) { background: var(--accent); }
.public-page .aurora span:nth-child(2) { background: color-mix(in srgb, var(--accent) 60%, #ff6b8b); }
.public-page .aurora span:nth-child(3) { background: color-mix(in srgb, var(--accent) 50%, #22d3ee); }
.public-page .aurora { position: fixed; }
.public-page .aurora span { opacity: .3; }
[data-theme="dark"] .public-page .aurora span { opacity: .25; }
.public-wrap { display: flex; flex-direction: column; align-items: center; padding: 48px 16px; min-height: 100vh; }
.public-wrap .vcard { box-shadow: var(--shadow-lg); }
.owner-bar { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .84rem; padding: 6px 8px 6px 14px; border-radius: 999px; margin-bottom: 20px; box-shadow: var(--shadow); }
.owner-bar a { color: var(--text); font-weight: 600; text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.owner-bar a:hover { background: var(--primary-soft); color: var(--primary-text); }
.powered { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; margin-top: 24px; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.powered strong { color: var(--text); }
.powered .brand-mark { width: 16px; height: 16px; border-radius: 5px; box-shadow: none; }
.powered .brand-mark::after { inset: 5px 4px; border-width: 1.5px; border-radius: 1px; }
.public-tools { position: fixed; top: 14px; right: 14px; z-index: 10; }

/* =========================================================
   Carte de visite
   ========================================================= */
.vcard {
    --accent: #6355ff;
    --on-accent: #fff;
    --accent-dark: color-mix(in srgb, var(--accent) 62%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 11%, #fff);
    --vc-surface: #f5f6fa;
    --vc-muted: #858aa3;
    width: 100%; max-width: 420px; background: #fff; color: #10132a; border-radius: 32px; overflow: hidden;
    box-shadow: var(--shadow); text-align: center; font-family: var(--font); color-scheme: light;
    container-type: inline-size;
}
/* Carte étroite : boutons plus compacts */
@container (max-width: 340px) {
    .vc-body { padding-left: 16px; padding-right: 16px; }
    .vc-btn { font-size: .82rem; padding: 12px 6px; min-width: 0; }
    .vc-actions .vc-btn:not(.icon-only) svg { display: none; }
    .vc-btn.icon-only { flex-basis: 44px; }
}
.vc-cover { height: 140px; background: radial-gradient(circle at 85% 0%, rgba(255, 255, 255, .35), transparent 50%), radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--accent) 40%, #ff6b8b), transparent 60%), linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.vc-body { padding: 0 22px 28px; }
.vc-avatar { width: 120px; height: 120px; border-radius: 50%; margin: -60px auto 16px; border: 5px solid #fff; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--on-accent); display: grid; place-items: center; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; overflow: hidden; position: relative; box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 70%, #000); }
.vc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vc-name { margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; word-break: break-word; }
.vc-role { margin: 6px 0 0; color: var(--accent-dark); font-weight: 600; font-size: .93rem; }
.vc-bio { margin: 14px auto 0; color: #5d6178; font-size: .92rem; max-width: 340px; line-height: 1.55; }
.vc-actions { display: flex; gap: 8px; margin: 22px 0 20px; }
.vc-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 13px 10px; border-radius: 16px; border: 0; font: inherit; font-weight: 700; font-size: .9rem; text-decoration: none; cursor: pointer; background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -12px var(--accent); transition: filter .15s, transform .15s var(--ease); }
.vc-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.vc-btn:active { transform: scale(.97); }
.vc-btn.alt { background: var(--accent-soft); color: var(--accent-dark); box-shadow: none; }
.vc-btn.icon-only { flex: 0 0 50px; padding: 13px 0; }
.vc-btn svg { width: 17px; height: 17px; }
.vc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.vc-item a { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 18px; text-decoration: none; color: inherit; background: var(--vc-surface); transition: background .2s, transform .2s var(--ease); }
.vc-item a:hover { background: var(--accent-soft); transform: translateX(3px); }
.vc-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #fff; color: var(--accent-dark); flex-shrink: 0; box-shadow: 0 2px 6px -2px rgba(15, 18, 34, .12); }
.vc-meta { min-width: 0; }
.vc-meta small { display: block; color: var(--vc-muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.vc-meta span { display: block; font-weight: 600; font-size: .93rem; word-break: break-word; }
.vc-social { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.vc-social a { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--vc-surface); color: var(--accent-dark); transition: transform .2s var(--ease), background .2s, color .2s; }
.vc-social a:hover { transform: translateY(-3px); background: var(--accent); color: var(--on-accent); }

.vc-status { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 0; padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #ecfdf5; color: #047857; }
.vc-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); } 70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.vc-section { margin-top: 26px; text-align: left; }
.vc-heading { margin: 0 0 10px; font-family: var(--font); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--vc-muted); display: flex; align-items: center; gap: 10px; }
.vc-heading::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .25; }
.vc-links { display: grid; gap: 8px; }
.vc-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent-dark); font-weight: 700; font-size: .93rem; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.vc-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-link svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.vc-link:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vc-link:hover svg { transform: translate(2px, -2px); }
.vc-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.vc-tags li { padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent-dark); }

.vc-portfolio { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vc-pf-item { position: relative; display: block; aspect-ratio: 1; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--vc-surface); font: inherit; }
.vc-portfolio > .vc-pf-item:first-child:nth-last-child(odd) { grid-column: span 2; aspect-ratio: 2 / 1; }
.vc-pf-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.vc-pf-item:hover img { transform: scale(1.07); }
.vc-pf-caption { position: absolute; inset: auto 0 0 0; padding: 26px 12px 9px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font-size: .78rem; font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vcard.has-cover .vc-cover { height: 160px; background-size: cover; background-position: center; }

/* Couleur d'accent claire (jaune, vert, cyan…) : textes d'accent plus foncés pour rester lisibles */
.vcard.on-light { --accent-dark: color-mix(in srgb, var(--accent) 42%, #000); }
.vcard.theme-gradient.on-light { --vc-surface: rgba(255, 255, 255, .32); --vc-muted: rgba(16, 19, 42, .65); color: #10132a;
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .3), transparent 45%), linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #000)); }
.theme-gradient.on-light .vc-role, .theme-gradient.on-light .vc-bio { color: rgba(16, 19, 42, .82); }
.theme-gradient.on-light .vc-btn { background: #10132a; color: #fff; }
.theme-gradient.on-light .vc-btn.alt { background: rgba(255, 255, 255, .4); color: #10132a; }
.theme-gradient.on-light .vc-ico, .theme-gradient.on-light .vc-social a, .theme-gradient.on-light .vc-tags li,
.theme-gradient.on-light .vc-link, .theme-gradient.on-light .vc-avatar { color: #10132a; }
.theme-gradient.on-light .vc-ico, .theme-gradient.on-light .vc-tags li { background: rgba(255, 255, 255, .45); }
.theme-gradient.on-light .vc-link { border-color: rgba(16, 19, 42, .25); }
.theme-gradient.on-light .vc-link:hover, .theme-gradient.on-light .vc-social a:hover { background: #10132a; color: #fff; border-color: #10132a; }
.theme-gradient.on-light .vc-status { background: rgba(255, 255, 255, .5); color: #065f46; }

/* Thème minimal */
.theme-minimal .vc-cover { height: 6px; background: var(--accent); }
.theme-minimal .vc-avatar { margin-top: 34px; box-shadow: 0 0 0 5px var(--accent-soft); border-color: #fff; }
.theme-minimal .vc-item a { background: transparent; border: 1px solid #eceef5; }
.theme-minimal .vc-ico { box-shadow: none; background: var(--accent-soft); }
.theme-minimal .vc-social a { background: transparent; border: 1px solid #e4e6f0; }
.theme-minimal.has-cover .vc-avatar { margin-top: -60px; }

/* Thème sombre */
.vcard.theme-dark { --vc-surface: #181d30; --vc-muted: #8b91a9; --accent-soft: color-mix(in srgb, var(--accent) 20%, #0e1222); background: #0e1222; color: #f3f4f6; color-scheme: dark; }
.theme-dark .vc-avatar { border-color: #0e1222; }
.theme-dark .vc-role, .theme-dark .vc-link, .theme-dark .vc-tags li, .theme-dark .vc-social a { color: color-mix(in srgb, var(--accent) 50%, #fff); }
.theme-dark .vc-bio { color: #a6abc0; }
.theme-dark .vc-btn.alt { color: #fff; }
.theme-dark .vc-item a:hover { background: #222a44; }
.theme-dark .vc-ico { background: #232a43; color: color-mix(in srgb, var(--accent) 45%, #fff); box-shadow: none; }
.theme-dark .vc-link:hover, .theme-dark .vc-social a:hover { color: var(--on-accent); }

/* Thème dégradé */
.vcard.theme-gradient { --vc-surface: rgba(255, 255, 255, .13); --vc-muted: rgba(255, 255, 255, .7); background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .25), transparent 45%), linear-gradient(160deg, var(--accent), var(--accent-dark)); color: #fff; }
.theme-gradient .vc-cover { background: transparent; height: 96px; }
.theme-gradient .vc-avatar { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .2); margin-top: -40px; box-shadow: none; }
.theme-gradient.has-cover .vc-avatar { margin-top: -60px; }
.theme-gradient .vc-role, .theme-gradient .vc-bio { color: rgba(255, 255, 255, .85); }
.theme-gradient .vc-btn { background: #fff; color: var(--accent-dark); box-shadow: none; }
.theme-gradient .vc-btn.alt { background: rgba(255, 255, 255, .18); color: #fff; }
.theme-gradient .vc-item a:hover { background: rgba(255, 255, 255, .22); }
.theme-gradient .vc-ico { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.theme-gradient .vc-link { color: #fff; border-color: rgba(255, 255, 255, .35); }
.theme-gradient .vc-link:hover { background: #fff; color: var(--accent-dark); border-color: #fff; }
.theme-gradient .vc-tags li { background: rgba(255, 255, 255, .16); color: #fff; }
.theme-gradient .vc-social a { color: #fff; }
.theme-gradient .vc-social a:hover { background: #fff; color: var(--accent-dark); }
.theme-gradient .vc-status { background: rgba(255, 255, 255, .18); color: #fff; }

/* Thème aurore (verre dépoli sur fond lumineux) */
.vcard.theme-aurora {
    --vc-surface: rgba(255, 255, 255, .07); --vc-muted: rgba(255, 255, 255, .55);
    background:
        radial-gradient(420px 320px at 0% 0%, color-mix(in srgb, var(--accent) 75%, transparent), transparent 70%),
        radial-gradient(380px 300px at 100% 12%, color-mix(in srgb, var(--accent) 35%, #ff5f8f), transparent 70%),
        radial-gradient(420px 360px at 50% 100%, color-mix(in srgb, var(--accent) 40%, #22d3ee), transparent 70%),
        #0b0a1d;
    color: #fff; color-scheme: dark;
}
.theme-aurora .vc-cover { background: transparent; height: 100px; }
.theme-aurora.has-cover .vc-cover { mask-image: linear-gradient(#000 55%, transparent); -webkit-mask-image: linear-gradient(#000 55%, transparent); }
.theme-aurora .vc-avatar { margin-top: -44px; border: 1px solid rgba(255, 255, 255, .3); padding: 5px; background: rgba(255, 255, 255, .1); backdrop-filter: blur(10px); box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .6); }
.theme-aurora.has-cover .vc-avatar { margin-top: -60px; }
.theme-aurora .vc-avatar img, .theme-aurora .vc-avatar span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; object-fit: cover; }
.theme-aurora .vc-avatar span { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #ff5f8f)); }
.theme-aurora .vc-role { color: color-mix(in srgb, var(--accent) 35%, #fff); }
.theme-aurora .vc-bio { color: rgba(255, 255, 255, .72); }
.theme-aurora .vc-btn { background: #fff; color: #0b0a1d; box-shadow: 0 10px 30px -10px rgba(255, 255, 255, .45); }
.theme-aurora .vc-btn.alt, .theme-aurora .vc-item a, .theme-aurora .vc-social a, .theme-aurora .vc-link, .theme-aurora .vc-tags li {
    background: rgba(255, 255, 255, .07); color: #fff; border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: none;
}
.theme-aurora .vc-item a:hover, .theme-aurora .vc-social a:hover, .theme-aurora .vc-link:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .25); }
.theme-aurora .vc-ico { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: none; }
.theme-aurora .vc-status { background: rgba(16, 185, 129, .16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, .3); }
.theme-aurora .vc-pf-item { border: 1px solid rgba(255, 255, 255, .1); }

/* Animation d'entrée de la carte sur la page publique */
.public-page .vcard { animation: card-in .7s var(--ease) both; }
.public-page .vc-body > * { animation: fade-up .6s var(--ease) both; }
.public-page .vc-body > :nth-child(1) { animation-delay: .1s; }
.public-page .vc-body > :nth-child(2) { animation-delay: .16s; }
.public-page .vc-body > :nth-child(3) { animation-delay: .22s; }
.public-page .vc-body > :nth-child(4) { animation-delay: .28s; }
.public-page .vc-body > :nth-child(5) { animation-delay: .34s; }
.public-page .vc-body > :nth-child(n+6) { animation-delay: .4s; }

/* ---------- Modales ---------- */
.modal, .lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden], .lightbox[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 20, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s; }
.modal-panel { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 30px; width: 100%; max-width: 370px; text-align: center; box-shadow: var(--shadow-lg); animation: pop .3s var(--ease); }
.modal-panel h2 { margin: 0; font-size: 1.35rem; }
.modal-panel .muted { margin: 6px 0 18px; font-size: .9rem; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-close:hover { color: var(--text); }
.qr-box { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 20px; min-height: 240px; box-shadow: 0 0 0 1px var(--border); }
.qr-box img, .qr-box canvas { max-width: 100%; }
.qr-url { font-size: .8rem; color: var(--muted); word-break: break-all; margin: 14px 0 18px; }

.lightbox { z-index: 55; }
.lightbox .modal-backdrop { background: rgba(5, 6, 14, .88); }
.lb-panel { position: relative; margin: 0; width: 100%; max-width: 880px; background: var(--surface); border-radius: 24px; overflow: hidden; animation: pop .3s var(--ease); box-shadow: var(--shadow-lg); }
.lb-panel > img { display: block; width: 100%; max-height: 68vh; object-fit: contain; background: #07080e; }
.lb-panel figcaption { padding: 20px 24px 24px; }
.lb-panel h2 { margin: 2px 0 6px; font-size: 1.3rem; }
.lb-panel p { margin: 0 0 14px; color: var(--muted); font-size: .93rem; white-space: pre-line; }
.lb-count { font-size: .74rem; font-weight: 700; color: var(--faint); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.lb-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); backdrop-filter: blur(8px); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav { position: absolute; top: 34vh; z-index: 2; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: #0f1222; font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.lb-nav:hover { transform: translateY(-50%) scale(1.08); }
.lb-nav[hidden] { display: none; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .3s var(--ease); }
.toast::before { content: '✓'; width: 20px; height: 20px; border-radius: 50%; background: #10b981; color: #fff; display: grid; place-items: center; font-size: .72rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animations ---------- */
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-8px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(30px) scale(.97); } }

.anim-done .vcard, .anim-done .vc-body > *, .anim-done .dash-item, .anim-done .auth-card { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
    .editor { grid-template-columns: 1fr; }
    .editor-preview { position: static; order: -1; }
    .editor-preview .phone-screen { max-height: 560px; }
    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 48px; gap: 64px; }
    .lead { margin: 0 auto; }
    .hero-cta, .hero-proof { justify-content: center; }
    .bento { grid-template-columns: repeat(2, 1fr); }
    .tile, .tile.wide { grid-column: span 1; }
    .themes-show { grid-template-columns: repeat(3, 1fr); }
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .pf-layout { grid-template-columns: 1fr; }
    .pf-add { position: static; }
}
@media (max-width: 680px) {
    body { font-size: 14.5px; }
    .container { padding: 0 16px; }
    .topbar-inner { height: 60px; }
    .nav-link.hide-sm, .user-chip .name, .hide-xs { display: none; }
    .brand { font-size: 1.12rem; }
    .nav { gap: 4px; }
    .user-chip { padding: 3px; }
    .grid-2, .bento, .steps, .stat-row { grid-template-columns: 1fr; }
    .stats-strip { grid-template-columns: 1fr 1fr; }
    .stats-strip div:nth-child(3) { border-left: 0; }
    .stats-strip div:nth-child(n+3) { border-top: 1px solid var(--border); }
    .themes-show { grid-template-columns: repeat(2, 1fr); }
    .theme-picker { grid-template-columns: repeat(3, 1fr); }
    .float-chip { display: none; }
    .section { padding-top: 64px; }
    .cta-band { padding: 48px 20px; border-radius: 24px; }
    .dash-grid { grid-template-columns: 1fr; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .public-wrap { padding: 0 0 24px; }
    .public-wrap .vcard { border-radius: 0 0 32px 32px; max-width: none; }
    .owner-bar { border-radius: 0; width: 100%; justify-content: center; margin: 0; box-shadow: none; border-width: 0 0 1px; }
    .link-row { grid-template-columns: 1fr auto; }
    .link-row input[name="link_url[]"] { grid-column: 1; grid-row: 2; }
    .pf-item { grid-template-columns: 76px minmax(0, 1fr); }
    .pf-thumb { width: 76px; height: 76px; }
    .pf-tools { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
    .lb-nav { top: 30vh; }
    .form-footer { bottom: 8px; }
}
