
/* Civora export v10 — aislado del editor para no heredar escalas responsive */
:root{--export-bg:#ecece8;--export-ink:#17191f;--export-muted:#6c727c;--export-primary:#5b5bd6}
html,body.export-body{margin:0;min-height:100%;background:var(--export-bg);color:var(--export-ink)}
.export-body{overflow-x:auto}
.export-toolbar{
  position:sticky;top:0;z-index:80;display:grid;grid-template-columns:auto minmax(220px,1fr) auto;
  align-items:center;gap:18px;padding:12px 18px;background:rgba(255,255,255,.96);
  border-bottom:1px solid #e2e5e9;backdrop-filter:blur(16px)
}
.export-toolbar-copy{display:grid;gap:2px;min-width:0}
.export-toolbar-copy strong{font-size:.9rem}
.export-toolbar-copy span{font-size:.74rem;color:var(--export-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.export-toolbar-actions{display:flex;gap:9px;justify-content:flex-end}
.export-format-btn{min-width:132px}
.export-format-btn:disabled{opacity:.55;cursor:wait;transform:none!important}
.export-wrap{
  min-height:calc(100vh - 67px);display:flex;align-items:flex-start;justify-content:center;
  padding:28px 20px 48px;background:
  radial-gradient(circle at 50% 0,rgba(91,91,214,.08),transparent 28%),var(--export-bg)
}
.export-page{
  flex:none;width:210mm!important;min-height:297mm!important;height:297mm!important;max-height:297mm!important;
  overflow:hidden!important;margin:0!important;transform:none!important;box-shadow:0 22px 70px rgba(20,25,35,.16)
}
.export-page>.cv-template{min-height:297mm!important}
.export-missing{width:min(calc(100% - 32px),620px);margin:70px auto;background:#fff;border:1px solid #e2e5e9;border-radius:18px;padding:34px;text-align:center}

/* Overlay de progreso: esfera con líquido + anillo en rotación */
.export-progress{
  position:fixed;inset:0;z-index:999;display:grid;place-items:center;padding:20px;
  background:rgba(14,17,24,.48);backdrop-filter:blur(10px)
}
.export-progress[hidden]{display:none!important}
.export-progress-card{
  width:min(92vw,360px);padding:28px 26px 24px;background:#fff;border:1px solid rgba(255,255,255,.75);
  border-radius:24px;box-shadow:0 28px 90px rgba(0,0,0,.23);text-align:center
}
.export-progress-card strong{display:block;margin-top:18px;font-size:1.05rem}
.export-progress-card p{margin:7px 0 0;color:var(--export-muted);font-size:.85rem;line-height:1.45}
.liquid-loader{
  --liquid:#665cff;position:relative;width:108px;height:108px;margin:0 auto;border-radius:50%;
  overflow:hidden;background:#f2f2ff;border:1px solid #dadaff;box-shadow:inset 0 0 0 7px #fff,0 12px 34px rgba(91,91,214,.16)
}
.liquid-loader:after{
  content:"";position:absolute;inset:-6px;border-radius:50%;border:3px solid transparent;
  border-top-color:var(--liquid);border-right-color:rgba(102,92,255,.28);
  animation:exportSpin .9s linear infinite;z-index:5;pointer-events:none
}
.liquid-loader-fill{
  position:absolute;left:0;right:0;bottom:0;height:0;background:
  linear-gradient(180deg,#8279ff 0%,#5d55ec 100%);transition:height .3s cubic-bezier(.2,.8,.2,1);z-index:1
}
.liquid-loader-wave{
  position:absolute;width:150px;height:150px;left:50%;bottom:calc(var(--export-progress,0)*1% - 78px);
  margin-left:-75px;border-radius:43%;background:rgba(255,255,255,.32);z-index:2;
  transform-origin:50% 49%;pointer-events:none
}
.wave-one{animation:exportWave 2.4s linear infinite}
.wave-two{opacity:.34;animation:exportWave 3.2s linear infinite reverse}
.liquid-loader>span{
  position:absolute;inset:0;display:grid;place-items:center;z-index:4;color:#23213f;font-weight:900;
  font-size:1.05rem;text-shadow:0 1px 8px rgba(255,255,255,.86)
}
.export-toast{
  position:fixed;right:18px;bottom:18px;z-index:1000;max-width:min(420px,calc(100vw - 36px));
  padding:12px 15px;border-radius:12px;background:#20242b;color:#fff;box-shadow:0 15px 44px rgba(0,0,0,.2);
  font-size:.83rem;font-weight:750
}
.export-toast[hidden]{display:none!important}
.export-toast.is-error{background:#9d2e3b}

@keyframes exportSpin{to{transform:rotate(360deg)}}
@keyframes exportWave{to{transform:rotate(360deg)}}

@media(max-width:760px){
  .export-toolbar{grid-template-columns:1fr auto;padding:10px}
  .export-toolbar>a{grid-column:1}
  .export-toolbar-copy{display:none}
  .export-toolbar-actions{grid-column:2;grid-row:1;gap:6px}
  .export-format-btn{min-width:0;padding:0 11px;font-size:.73rem}
  .export-wrap{padding:16px 0 36px;justify-content:flex-start;overflow-x:auto}
  .export-page{transform-origin:top left!important}
}

/*
  Impresión: una sola hoja A4, sin header/footer de la web, sin segunda página
  fantasma y conservando fondos/colores de la plantilla.
*/
@page{size:A4 portrait;margin:0}
@media print{
  html,body.export-body{
    width:210mm!important;height:297mm!important;min-width:210mm!important;min-height:297mm!important;
    margin:0!important;padding:0!important;background:#fff!important;overflow:hidden!important
  }
  body.export-body{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  .no-print,.export-toolbar,.export-progress,.export-toast,.export-missing{display:none!important}
  .export-wrap{
    display:block!important;width:210mm!important;height:297mm!important;min-height:0!important;
    margin:0!important;padding:0!important;background:#fff!important;overflow:hidden!important
  }
  .export-page{
    width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;
    margin:0!important;padding:0!important;box-shadow:none!important;transform:none!important;overflow:hidden!important;
    page-break-before:auto!important;page-break-after:auto!important;page-break-inside:avoid!important;
    break-before:auto!important;break-after:auto!important;break-inside:avoid-page!important;
    -webkit-print-color-adjust:exact!important;print-color-adjust:exact!important
  }
  .export-page,.export-page *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  .export-page>.cv-template{min-height:297mm!important}
}
@media(prefers-reduced-motion:reduce){
  .liquid-loader:after,.liquid-loader-wave{animation:none!important}
}


/* Civora v12 — exportación móvil */
@media(max-width:760px){
  .export-body{overflow-x:hidden!important}
  .export-toolbar{
    position:sticky;top:0;z-index:90;grid-template-columns:44px minmax(0,1fr)!important;
    gap:7px!important;padding:8px max(8px,env(safe-area-inset-right)) 8px max(8px,env(safe-area-inset-left))!important
  }
  .export-toolbar>a{width:44px!important;height:42px!important;overflow:hidden;font-size:0!important;padding:0!important}
  .export-toolbar>a::before{content:'←';font-size:1rem}
  .export-toolbar-actions{grid-column:2!important;grid-row:1!important;display:grid!important;grid-template-columns:1fr 1fr!important;width:100%}
  .export-format-btn{min-height:42px!important;font-size:.72rem!important;padding:0 8px!important}
  .export-wrap{
    min-height:calc(100dvh - 58px)!important;padding:12px 8px 30px!important;justify-content:center!important;overflow:hidden!important
  }
  .export-page{transform-origin:top center!important}
  .export-progress{padding:12px!important}.export-progress-card{border-radius:20px!important;padding:22px 18px!important}
  .liquid-loader{width:94px!important;height:94px!important}
  .export-toast{left:10px!important;right:10px!important;bottom:max(10px,env(safe-area-inset-bottom))!important;max-width:none!important}
}


/* =========================================================
   Civora V13 — exportación mobile-fit
   ========================================================= */
.export-preview-stage{
  position:relative;width:210mm;height:297mm;flex:none;margin:0 auto;
  border-radius:2px;box-shadow:0 22px 70px rgba(20,25,35,.16)
}
.export-preview-stage .export-page{box-shadow:none!important}
.export-back-btn{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.export-back-btn b{font:inherit}

@media(max-width:900px){
  .export-body{overflow-x:hidden!important}
  .export-toolbar{
    position:sticky!important;top:0!important;z-index:100!important;display:grid!important;
    grid-template-columns:46px minmax(0,1fr)!important;gap:8px!important;padding:8px 9px!important;min-height:58px!important
  }
  .export-back-btn{
    grid-column:1!important;grid-row:1!important;width:46px!important;height:42px!important;min-width:46px!important;padding:0!important;
    display:grid!important;place-items:center!important;border-radius:12px!important
  }
  .export-back-btn span{font-size:1rem!important}.export-back-btn b{display:none!important}
  .export-toolbar-copy{display:none!important}
  .export-toolbar-actions{
    grid-column:2!important;grid-row:1!important;display:grid!important;grid-template-columns:1fr 1fr!important;
    gap:7px!important;width:100%!important
  }
  .export-format-btn{
    min-width:0!important;width:100%!important;height:42px!important;min-height:42px!important;padding:0 8px!important;
    border-radius:12px!important;font-size:.69rem!important;line-height:1.08!important;white-space:nowrap!important
  }
  .export-wrap{
    min-height:calc(100dvh - 58px)!important;padding:14px 10px 30px!important;display:flex!important;justify-content:center!important;
    align-items:flex-start!important;overflow:hidden!important
  }
  .export-preview-stage{margin:0 auto!important;box-shadow:0 16px 44px rgba(20,25,35,.16)!important}
  .export-page{margin:0!important}
}
@media(max-width:360px){
  .export-format-btn{font-size:.64rem!important;padding-inline:5px!important}
}
@media print{
  .export-preview-stage{
    position:static!important;width:210mm!important;height:297mm!important;margin:0!important;box-shadow:none!important;transform:none!important
  }
  .export-preview-stage .export-page{
    position:static!important;left:auto!important;top:auto!important;transform:none!important
  }
}
