/* Helvia Studio : création des applications 3D (anglais) */
@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root { --brand: #4f46e5; --brand-2: #4338ca; --brand-soft: #eef2ff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f1f5f9; --ok: #16a34a; --ok-soft: #dcfce7; --warn-soft: #fef3c7; --bad: #dc2626; --bad-soft: #fee2e2; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "IBM Plex Sans", system-ui, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.top { position: sticky; top: 0; z-index: 10; height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; text-decoration: none; color: var(--text); }
.logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; font-style: normal; }
.logo i::after { content: ""; width: 11px; height: 11px; background: #fff; transform: rotate(45deg); border-radius: 2px; }
.logo small { font-weight: 500; color: var(--muted); font-size: 13px; }
.crumb { color: var(--muted); margin-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--text); }
.sp { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { border-color: #cbd5e1; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: #166534; }
.chip.warn { background: var(--warn-soft); color: #92400e; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.bad { background: var(--bad-soft); color: #991b1b; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
h1 { font-size: 24px; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
label.f { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.in, select.in, textarea.in { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; background: #fff; font-size: 13.5px; }
.in:focus { outline: 2px solid #c7d2fe; border-color: var(--brand); }
.fld { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: #3730a3; font-size: 13px; margin: 10px 0; }
.note.warn { background: var(--warn-soft); color: #92400e; }
.note.err { background: var(--bad-soft); color: #991b1b; }
.note.ok { background: var(--ok-soft); color: #166534; }

/* Connexion */
.auth { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth h1 { margin-bottom: 6px; }
.auth .alt { margin-top: 16px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pitch { max-width: 420px; margin: 0 auto 18px; text-align: center; color: var(--muted); }

/* Mes applications */
.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 32px 60px; }
.head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.app { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.app:hover { border-color: #c7d2fe; box-shadow: 0 6px 20px rgba(79, 70, 229, .08); }
.app .th { height: 168px; background: #e7eaf0; position: relative; display: grid; place-items: center; }
.app .th svg { width: 100%; height: 100%; }
.app .th .chip { position: absolute; top: 10px; left: 10px; background: #fff; }
.app .bd { padding: 14px 16px 16px; }
.app .bd p { font-size: 12.5px; color: var(--muted); margin: 4px 0 10px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.newcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #c7d2fe; background: #fafbff; color: var(--brand); min-height: 280px; cursor: pointer; text-align: center; padding: 16px; }
.newcard i { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); color: #fff; font-style: normal; font-size: 26px; display: grid; place-items: center; }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tpl { display: flex; gap: 12px; padding: 12px; align-items: center; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.tpl:hover, .tpl.on { border-color: var(--brand); background: var(--brand-soft); }
.tpl .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; background: var(--bg); flex: none; }
.tpl b { display: block; font-size: 13.5px; }
.tpl small { color: var(--muted); font-size: 12px; }

/* Application : étapes */
.lay { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
.steps { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow: auto; }
.st { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 10px; margin-bottom: 3px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.st:hover { background: var(--bg); }
.st i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12px; background: var(--bg); color: var(--muted); flex: none; }
.st.done i { background: var(--ok); color: #fff; }
.st.on { background: var(--brand-soft); }
.st.on i { background: var(--brand); color: #fff; }
.st.on.done i { background: var(--ok); color: #fff; }
.st b { font-size: 13.5px; display: block; }
.st small { font-size: 11.5px; color: var(--muted); display: block; }
.main { padding: 26px 30px 80px; min-width: 0; }
.main .lead { color: var(--muted); margin: 6px 0 18px; max-width: 760px; }
.foot { display: flex; gap: 10px; margin-top: 22px; align-items: center; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.tbl td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr:first-child td { border-top: 0; }
.tbl .in { min-height: 32px; padding: 5px 9px; }
.tbl small { display: block; color: var(--muted); font-size: 12px; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.x:hover { background: var(--bad-soft); color: var(--bad); }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); padding: 0; cursor: pointer; }
.wf { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.wf:first-child { border-top: 0; }
.wf small { color: var(--muted); }
.list { background: #fff; border: 1px solid var(--line); border-radius: 14px; max-height: 420px; overflow: auto; }
.typecard { padding: 16px; margin-bottom: 14px; }
.typecard .hd { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.flow .chip { background: var(--brand-soft); color: var(--brand); }

/* Plan (éditeur 2D) */
.plan-lay { display: grid; grid-template-columns: 1fr 290px; gap: 16px; align-items: start; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; position: relative; user-select: none; }
.plan svg { display: block; width: 100%; height: 560px; touch-action: none; }
.plan .tools { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.palette button { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 4px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.palette button span { display: block; font-size: 18px; }
.palette button:hover { border-color: var(--brand); background: var(--brand-soft); }
.side { padding: 16px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-left: 1px solid var(--line); background: #fff; padding: 7px 0; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--brand-soft); color: var(--brand); }

/* Fenêtre */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(760px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(15, 23, 42, .3); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog .dh { padding: 20px 22px 0; }
dialog .db { padding: 16px 22px; max-height: 65vh; overflow: auto; }
dialog .df { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 11px; font-size: 13.5px; z-index: 50; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); max-width: calc(100vw - 32px); }
.toast.err { background: #991b1b; }
.saving { font-size: 12px; }
@media (max-width: 860px) {
  .lay { grid-template-columns: 1fr; }
  .steps { position: static; height: auto; display: flex; overflow-x: auto; gap: 4px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .st { width: auto; flex: none; }
  .st small { display: none; }
  .main { padding: 20px 16px 60px; }
  .plan-lay { grid-template-columns: 1fr; }
  .wrap { padding: 20px 16px 50px; }
  .row2 { grid-template-columns: 1fr; }
  .crumb { display: none; }
}

/* Glisser un objet de la palette vers le plan */
.palette button { touch-action: none; }
.drag-ghost { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); display: grid; place-items: center; font-size: 22px; box-shadow: 0 8px 20px rgba(79, 70, 229, .25); }
.plan.drop { outline: 2px dashed var(--brand); outline-offset: -4px; }

/* Étape « The app » : aperçu réel de l'application (page d'aperçu du brouillon, mode Demo) */
.app-step { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 24px; padding: 20px; width: 100%; box-sizing: border-box; }
.app-form { min-width: 0; }
.app-preview { position: relative; width: 100%; min-height: 460px; height: calc(100vh - 290px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #e7eaf0; }
@media (max-width: 900px) { .app-step { grid-template-columns: 1fr; } .app-preview { height: 420px; min-height: 0; } }
.app-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.card.app .desc { color: #475569; margin: 2px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Palette des objets du plan : sections, filtre, objets animés ; vie de la scène */
.pal-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.pal-head .in.small { max-width: 170px; padding: 6px 10px; font-size: 13px; }
.pal-list { max-height: 460px; overflow: auto; padding-right: 4px; }
.pal-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 6px; }
.pal-sec h3 small { font-weight: 500; color: #94a3b8; }
.pal-sec:first-child h3 { margin-top: 0; }
.palette button { position: relative; line-height: 1.2; }
.palette button i.anim, span.anim { color: #16a34a; font-style: normal; font-size: 9px; }
.palette button i.anim { position: absolute; top: 4px; right: 6px; }
.life-row { margin-bottom: 8px; }
.life-row label { display: flex; justify-content: space-between; }
.life-row input[type=range] { width: 100%; accent-color: var(--brand); }
/* Modèles de l'accueil : aperçu 3D et filtre */
.tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.tpl-head h2 { margin: 0; }
.tpl-head .in { max-width: 240px; }
.tpls .tpl { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; }
.tpls .tpl .shot { display: block; aspect-ratio: 16 / 10; background: #e7eaf0 center / cover no-repeat; border-bottom: 1px solid var(--line); }
.tpls .tpl .tx { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px 12px; text-align: left; }
