/* Agreements: the booking's Agreement tab, the client's Agreement page, the A4 paper, and the print layout (the PDF). */

/* ---- the studio's tab ---- */
.agr-card .alert{align-items:flex-start}
.agr-note{font-size:12px;line-height:1.45;color:var(--muted);background:var(--soft);border-radius:10px;padding:8px 10px;margin:0 0 12px}
.agr-steps{display:flex;flex-wrap:wrap;gap:6px 14px;list-style:none;margin:0;padding:0;counter-reset:s}
.agr-steps li{counter-increment:s;display:flex;align-items:center;gap:7px;font-size:13px;color:var(--muted)}
.agr-steps li::before{content:counter(s);display:grid;place-items:center;width:22px;height:22px;border-radius:50%;border:1.5px solid var(--border);font-size:11px;font-weight:600;flex:none}
.agr-steps li.on{color:var(--ink);font-weight:500}
.agr-steps li.on::before{content:"✓";background:var(--primary);border-color:var(--primary);color:#fff}
.agr-linkbox{display:flex;gap:8px;align-items:center}
.agr-linkbox input{flex:1 1 auto;min-width:0;font-size:13px}
.dot-note{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--primary);vertical-align:middle;margin-left:4px}
.split-check{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0 0 10px;padding:8px 10px;border-radius:10px;background:var(--soft);overflow-wrap:anywhere}
.split-check svg.i{width:16px;height:16px;color:var(--primary);flex:none}
.agr-err{margin-top:4px}
.sigprev{display:flex;align-items:center;justify-content:center;min-height:72px;padding:8px;background:#fff;border:1px dashed var(--border);border-radius:12px}.sigprev img{display:block;max-width:100%;max-height:90px;object-fit:contain}.sigprev .sig-typed{font-family:'Allura','Cormorant Garamond',cursive;font-size:30px;line-height:1.2;color:#141414}
.agr-yn{display:grid;gap:8px}
.agr-yn label{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;border:1px solid var(--border);border-radius:12px;cursor:pointer}
.agr-yn input{width:20px;height:20px;flex:none;margin:0;accent-color:var(--primary)}
.agr-yn label:has(input:checked){border-color:var(--primary);background:var(--tint)}
.agr-pad{position:relative}
.agr-pad canvas{display:block;width:100%;height:auto;aspect-ratio:560/180;background:#fff;border:1.5px dashed var(--border);border-radius:12px;touch-action:none;cursor:crosshair}
.agr-pad .btn{position:absolute;right:8px;top:8px}
.chk{display:flex;gap:10px;align-items:flex-start;margin:10px 0;font-size:14px;line-height:1.4}
.chk input{width:20px;height:20px;flex:none;margin:1px 0 0;accent-color:var(--primary)}

/* ---- the paper ----
   Wide screens and print: real A4 sheets (210 x 297 mm) with the studio letterhead on page 1, a running header after it, and a footer with
   "Page n of N", the same look as the quotations and invoices. Phones: the same text flowing on one sheet, with the same letterhead and footer.
   Sheets are built by A.paper() in agreements.js, which measures the text in these exact styles, so the preview is the PDF. */
.agr-wrap{container-type:inline-size}
.agr-pages{display:none}
.agr-flow{display:block}
@container (min-width:560px){.agr-pages{display:flex}.agr-flow{display:none}}

/* the shared look of the text, in print units so the measuring and the page agree */
.agr-doc{font-family:'Poppins',system-ui,sans-serif;color:#141414;overflow-wrap:break-word;word-break:normal;font-size:9.2pt;line-height:1.5}
.agr-doc h1,.agr-doc h2,.agr-doc p,.agr-doc li,.agr-doc td,.agr-doc th{color:#141414}
.agr-doc h2{font:400 12.5pt/1.15 var(--twf-font-display,'Cormorant Garamond',Georgia,serif);letter-spacing:.04em;text-transform:none;margin:6mm 0 2.5mm;padding-bottom:1.5mm;border-bottom:1px solid #E4E0E0}
.agr-doc p{margin:0 0 2.2mm}
.agr-doc ol,.agr-doc ul{margin:0 0 2.5mm;padding-left:5mm}
.agr-doc li{margin:0 0 1.4mm;padding-left:1mm}
.agr-doc b{font-weight:600}
.agr-doc hr{border:0;border-top:1px solid #E4E0E0;margin:5mm 0 3mm}
.agr-doc blockquote{margin:3mm 0;padding:2mm 3mm;border-left:1mm solid #910000;background:#F7F5F5;font-size:8.4pt}
.agr-doc .agr-tw{margin:2mm 0 3.5mm}
.agr-doc table{width:100%;border-collapse:collapse;font-size:8.5pt}
.agr-doc th{font-size:6.8pt;font-weight:500;letter-spacing:.12em;text-transform:uppercase;color:#5F5858;text-align:left;padding:1.6mm 2mm;border-bottom:1.4px solid #141414;vertical-align:bottom}
.agr-doc td{padding:2mm 2mm;border-bottom:1px solid #E4E0E0;text-align:left;vertical-align:top;overflow-wrap:break-word;hyphens:manual}
.agr-doc tr{break-inside:avoid}
.agr-doc table:not(:has(thead)) td:first-child{width:32%;color:#5F5858;font-weight:500;background:#F7F5F5}
.agr-doc table:not(:has(thead)) td:first-child b{font-weight:500}
.agr-doc mark.agr-miss{background:#FFF1B8;color:#7a4a00;border-bottom:2px solid #E0A100;padding:0 1mm;border-radius:1mm;font-size:.92em;white-space:normal}
.agr-doc .agr-sig{display:flex;flex-direction:column;gap:.5mm;min-width:0}
.agr-doc .agr-sig img{display:block;max-width:100%;max-height:16mm;object-fit:contain;object-position:left}
.agr-doc .agr-sig .typed{font-family:'Allura','Cormorant Garamond',cursive;font-size:17pt;line-height:1.1}
.agr-doc .agr-sig small{font-size:6.5pt;color:#5F5858}
.agr-doc .agr-evid h2{margin-top:0}
.agr-doc .agr-evid td:first-child{width:34%;font-weight:600;background:#F7F5F5}
.agr-doc .agr-evid td{font-size:8pt;word-break:break-all}

/* letterhead, running header, footer */
.agr-lh{display:flex;justify-content:space-between;align-items:flex-start;gap:8mm;margin:0 0 5mm;padding-bottom:5mm;border-bottom:1px solid #E4E0E0}
.agr-lh img{display:block;width:54mm;max-width:100%;height:auto}
.agr-lh .agr-bn{font:400 20pt/1.1 var(--twf-font-display,'Cormorant Garamond',serif)}
.agr-lh .co{margin-top:3mm;font-size:7.5pt;line-height:1.5;color:#5F5858}
.agr-lh-r{text-align:right;min-width:0}
.agr-lh-r h1{margin:0;font:400 19pt/1.08 var(--twf-font-display,'Cormorant Garamond',serif);letter-spacing:.06em;text-transform:uppercase;color:#141414}
.agr-lh-r .bar{width:22mm;height:1.2mm;background:#910000;margin:2.5mm 0 3mm auto}
.agr-lh-r dl{display:grid;grid-template-columns:auto auto;gap:1mm 5mm;justify-content:end;margin:0;font-size:8pt}
.agr-lh-r dt{color:#5F5858;text-align:right}
.agr-lh-r dd{margin:0;font-weight:500;text-align:right}
.agr-tag{display:inline-block;font-size:6.2pt;letter-spacing:.1em;text-transform:uppercase;border:1px solid #910000;color:#910000;border-radius:99px;padding:.1mm 1.8mm}
.agr-ch{display:flex;justify-content:space-between;gap:6mm;font-size:7.5pt;color:#5F5858;padding-bottom:2.5mm;margin-bottom:3mm;border-bottom:1px solid #E4E0E0}
.agr-ch b{color:#141414;font-weight:500}
.agr-sf{display:flex;justify-content:space-between;gap:6mm;font-size:7.5pt;color:#5F5858;border-top:1px solid #E4E0E0;padding-top:2.5mm}

/* A4 sheets */
.agr-pages{flex-direction:column;align-items:center;gap:12px;background:var(--soft);padding:12px;border-radius:14px;overflow:hidden}
.agr-sheet{flex:none;width:210mm;height:297mm;box-sizing:border-box;position:relative;overflow:hidden;background:#fff;color:#141414;padding:13mm 14mm 20mm;box-shadow:0 1px 2px rgba(20,20,20,.08),0 8px 28px rgba(20,20,20,.12);zoom:var(--z,1)}
.agr-sheet>.agr-sf{position:absolute;left:14mm;right:14mm;bottom:9mm}
.agr-measure{position:absolute;left:-10000px;top:0;width:182mm;visibility:hidden;pointer-events:none}

/* the phone version: one flowing sheet */
.agr-paper-wrap{background:var(--soft);border-radius:14px;padding:10px;max-width:100%;overflow:hidden}
.agr-paper{background:#fff;color:#141414;max-width:794px;margin:0 auto;padding:clamp(16px,5vw,36px);border-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.12),0 8px 24px rgba(0,0,0,.06);font-size:13px;line-height:1.55}
.agr-flow .agr-doc{font-size:12.5px;line-height:1.55}
.agr-flow .agr-doc h2{font-size:17px;margin:20px 0 8px;padding-bottom:5px}
.agr-flow .agr-doc p{margin:0 0 9px}
.agr-flow .agr-doc ol,.agr-flow .agr-doc ul{margin:0 0 10px;padding-left:22px}
.agr-flow .agr-doc li{margin:0 0 6px}
.agr-flow .agr-doc table{font-size:12px}
.agr-flow .agr-doc th{font-size:9.5px;padding:6px 7px}
.agr-flow .agr-doc td{padding:7px}
.agr-flow .agr-lh{flex-wrap:wrap;gap:14px}
.agr-flow .agr-lh img{width:150px}
.agr-flow .agr-lh .co{font-size:11px}
.agr-flow .agr-lh-r h1{font-size:22px}
.agr-flow .agr-lh-r dl{font-size:12px}
.agr-flow .agr-sf{font-size:11px;margin-top:22px;padding-top:8px}
.agr-flow .agr-evid{margin-top:26px;padding-top:12px;border-top:2px solid #141414}
.agr-flow .agr-doc .agr-sig .typed{font-size:21px}
.agr-flow .agr-doc .agr-sig img{max-height:60px}
.agr-flow .agr-doc .agr-sig small{font-size:10px}
.cl .agr-paper-wrap{padding:6px;margin:0 -6px}
.agr-note{white-space:normal;overflow-wrap:anywhere;max-width:100%}
@media (max-width:560px){.agr-paper{padding:16px 12px}.agr-flow .agr-lh-r{text-align:left;width:100%}.agr-flow .agr-lh-r .bar{margin-left:0}.agr-flow .agr-lh-r dl{justify-content:start}.agr-flow .agr-lh-r dt,.agr-flow .agr-lh-r dd{text-align:left}}
@media (max-width:420px){
  .agr-paper-wrap{padding:6px}.agr-paper{padding:14px 10px}.agr-flow .agr-doc table{font-size:11px}
  .agr-flow .agr-doc th,.agr-flow .agr-doc td{padding:4px;overflow-wrap:anywhere}
  .agr-doc table.agr-stack thead{display:none}
  .agr-doc table.agr-stack,.agr-doc table.agr-stack tbody,.agr-doc table.agr-stack tr,.agr-doc table.agr-stack td{display:block;width:100%}
  .agr-doc table.agr-stack tr{border:1px solid #E4E0E0;margin:0 0 8px;border-radius:4px}
  .agr-doc table.agr-stack td{border:0;border-bottom:1px solid #eee;display:flex;gap:10px;justify-content:space-between;text-align:right;font-size:11.5px}
  .agr-doc table.agr-stack td:last-child{border-bottom:0}
  .agr-doc table.agr-stack td::before{content:attr(data-l);font-weight:600;color:#5F5858;text-align:left;flex:none}
}
.cl-bar a{overflow:hidden}

/* ---- printing: only the sheets, edge to edge on A4 ---- */
#agrPrint{display:none}
@page{size:A4;margin:0}
@media print{
  body.agr-printing{background:#fff!important;overflow:visible!important;margin:0}
  body.agr-printing > *:not(#agrPrint){display:none!important}
  body.agr-printing #agrPrint{display:block!important}
  #agrPrint .agr-pages{display:block!important;background:none;padding:0;border-radius:0;gap:0}
  #agrPrint .agr-flow{display:none!important}
  #agrPrint .agr-sheet{zoom:1!important;box-shadow:none;margin:0;break-after:page;page-break-after:always}
  #agrPrint .agr-sheet:last-child{break-after:auto;page-break-after:auto}
  #agrPrint *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* ---- signature pad (sigpad.js) ---- */
.sigpad .sp-mode{display:inline-flex;background:var(--soft);border-radius:99px;padding:3px;margin:0 0 8px}
.sigpad .sp-mode button{border:0;background:none;padding:6px 14px;border-radius:99px;font-size:13px;cursor:pointer;color:var(--ink);min-height:32px}
.sigpad .sp-mode .on{background:var(--card);box-shadow:0 1px 2px rgba(0,0,0,.14);font-weight:500}
.sigpad .sp-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 8px}
.sigpad .sp-tools.sp-off{opacity:.4;pointer-events:none}
.sigpad .sp-sw,.sigpad .sp-wd{display:flex;gap:6px;align-items:center}
.sigpad .sp-sw button{width:30px;height:30px;border-radius:50%;background:var(--c);border:2px solid #fff;box-shadow:0 0 0 1px var(--border);padding:0;cursor:pointer}
.sigpad .sp-sw button.on{box-shadow:0 0 0 2.5px var(--primary)}
.sigpad .sp-custom{position:relative;width:30px;height:30px;border-radius:50%;overflow:hidden;background:conic-gradient(red,yellow,lime,cyan,blue,magenta,red);box-shadow:0 0 0 1px var(--border);cursor:pointer}
.sigpad .sp-custom input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;padding:0;border:0}
.sigpad .sp-wd button{width:42px;height:30px;border:1px solid var(--border);border-radius:8px;background:var(--card);display:grid;place-items:center;padding:0;cursor:pointer}
.sigpad .sp-wd button i{display:block;width:22px;background:var(--ink);border-radius:9px}
.sigpad .sp-wd button.on{border-color:var(--primary);background:var(--tint)}
.sigpad .sp-stage{position:relative;background:#fff;border:1.5px dashed var(--border);border-radius:12px;overflow:hidden}
.sigpad .sp-stage canvas{display:block;width:100%;height:auto;aspect-ratio:700/220;cursor:crosshair;touch-action:none}
.sigpad .sp-hint{position:absolute;left:0;right:0;top:40%;text-align:center;color:#b9b9b9;font-size:14px;pointer-events:none}
.sigpad .sp-line{position:absolute;left:6%;right:6%;bottom:24%;border-bottom:1px solid #e0e0e0;pointer-events:none}
.sigpad .sp-type input{width:100%}
.sigpad .sp-prev{margin-top:8px;padding:10px 14px;background:#fff;border:1px dashed var(--border);border-radius:12px;font-family:'Allura','Cormorant Garamond',cursive;font-size:44px;line-height:1.25;min-height:64px;color:#141414;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.sigpad [hidden]{display:none!important}
.agr-doc .agr-await{display:block;min-height:15mm;padding-top:9mm;color:#9a9494;font-size:7.5pt;font-style:italic}
.agr-doc .agr-sigtab td{width:50%;border-bottom:0;vertical-align:bottom}
