@layer components.pages {/* ==========================================================================
   garment-liability-waiver.css — pages/forms/garment-liability-waiver.html
   Customer e-signature arrangement on top of printable-forms.css: staff
   send panel, waiver clause list, signature pad, consent row, sign button,
   signed panel. Portrait print; the paper copy carries the signature stamp.
   ========================================================================== */

@media print {
    @page { size: letter portrait; margin: 0.4in; }
}

:where([data-ui="unified"][data-form="printable"]) .req { color: var(--color-danger-ink); font-weight: 700; }
:where([data-ui="unified"][data-form="printable"]) .info-field--wide { grid-column: span 2; }

/* ── staff send panel (screen only) ─────────────────────────────────────── */
:where([data-ui="unified"][data-form="printable"]) .staff-send-panel {
    max-width: 8.5in;
    width: calc(100% - var(--space-8));
    margin: var(--space-6) auto calc(-1 * var(--space-5));
    padding: var(--space-4) var(--space-5);
    border: 1.5px solid var(--form-green);
    border-radius: var(--radius-md);
    background: var(--brand-50);
    color: var(--ink);
}
:where([data-ui="unified"][data-form="printable"]) .staff-send-title { margin: 0 0 var(--space-2); font-size: 1rem; font-weight: 700; }
:where([data-ui="unified"][data-form="printable"]) .staff-send-title .fa-paper-plane { color: var(--form-green); margin-right: var(--space-1); }
:where([data-ui="unified"][data-form="printable"]) .staff-send-text { margin: 0 0 var(--space-3); font-size: 0.9rem; line-height: 1.5; }
:where([data-ui="unified"][data-form="printable"]) .staff-send-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
:where([data-ui="unified"][data-form="printable"]) .staff-send-status { font-size: 0.85rem; font-weight: 600; color: var(--form-green-dark); }
:where([data-ui="unified"][data-form="printable"]) .staff-send-status.is-error { color: var(--color-danger-ink); }
:where([data-ui="unified"][data-form="printable"]) .staff-send-link { margin: var(--space-3) 0 0; font-size: 0.8rem; color: var(--ink-soft); overflow-wrap: anywhere; }
:where([data-ui="unified"][data-form="printable"]) .staff-send-link-url { font-family: var(--font-mono); font-size: 0.75rem; }

/* ── waiver clauses ─────────────────────────────────────────────────────── */
:where([data-ui="unified"][data-form="printable"]) .waiver-intro { margin: 0 0 var(--space-3); font-size: 0.9rem; line-height: 1.5; }
:where([data-ui="unified"][data-form="printable"]) .waiver-terms { margin: 0; padding-left: 1.4em; font-size: 0.86rem; line-height: 1.5; }
:where([data-ui="unified"][data-form="printable"]) .waiver-terms li { margin-bottom: var(--space-2); }
:where([data-ui="unified"][data-form="printable"]) .waiver-esign { margin: var(--space-3) 0 0; font-size: 0.86rem; line-height: 1.5; }
:where([data-ui="unified"][data-form="printable"]) .waiver-version { margin: var(--space-2) 0 0; font-size: 0.72rem; color: var(--ink-soft); text-align: end; }

/* ── signature pad + consent + sign ─────────────────────────────────────── */
:where([data-ui="unified"][data-form="printable"]) .sig-pad-block { margin-top: var(--space-4); }
:where([data-ui="unified"][data-form="printable"]) .sig-pad-label { margin: 0 0 var(--space-2); font-size: 0.82rem; font-weight: 600; }

:where([data-ui="unified"][data-form="printable"]) .sig-pad-wrap {
    position: relative;
    height: 170px;
    border: 1.5px solid var(--form-green);
    border-radius: var(--radius-sm);
    background: var(--paper);
}

:where([data-ui="unified"][data-form="printable"]) .sig-pad-wrap::after {
    content: '';
    position: absolute;
    left: var(--space-5);
    right: var(--space-5);
    bottom: 34px;
    border-bottom: 1px solid var(--line);
    pointer-events: none;
}

:where([data-ui="unified"][data-form="printable"]) .sig-pad {
    display: block;
    width: 100%;
    height: 100%;
    color: var(--ink);
    touch-action: none;
    cursor: crosshair;
    border-radius: inherit;
}
:where([data-ui="unified"][data-form="printable"]) .sig-pad.is-locked { cursor: default; }
:where([data-ui="unified"][data-form="printable"]) .sig-pad-x { position: absolute; left: var(--space-3); bottom: 30px; font-size: 1.1rem; color: var(--ink-soft); pointer-events: none; }
:where([data-ui="unified"][data-form="printable"]) .sig-pad-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-2); }
:where([data-ui="unified"][data-form="printable"]) .sig-pad-help { font-size: 0.8rem; color: var(--ink-soft); }

:where([data-ui="unified"][data-form="printable"]) .sig-consent {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--form-green);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
}
:where([data-ui="unified"][data-form="printable"]) .sig-consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--form-green); }
:where([data-ui="unified"][data-form="printable"]) .sign-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-4); }

:where([data-ui="unified"][data-form="printable"]) .sign-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 52px;
    padding: 0 var(--space-6);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--form-green);
    color: var(--color-on-brand);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}
:where([data-ui="unified"][data-form="printable"]) .sign-btn:hover { background: var(--form-green-dark); }
:where([data-ui="unified"][data-form="printable"]) .sign-btn:disabled { opacity: 0.6; cursor: default; }
:where([data-ui="unified"][data-form="printable"]) .sign-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
:where([data-ui="unified"][data-form="printable"]) .sign-privacy { margin: 0; font-size: 0.8rem; color: var(--ink-soft); }

:where([data-ui="unified"][data-form="printable"]) .sig-stamp {
    margin: var(--space-4) 0 0;
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--form-green);
    background: var(--brand-50);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.5;
}
:where([data-ui="unified"][data-form="printable"]) .waiver-banner { width: auto; max-width: none; margin: 0 0 var(--space-3); }

/* ── signed panel ───────────────────────────────────────────────────────── */
:where([data-ui="unified"][data-form="printable"]) .signed-panel {
    margin-top: var(--space-5);
    padding: var(--space-5);
    border: 1.5px solid var(--form-green);
    border-radius: var(--radius-md);
    background: var(--brand-50);
    text-align: center;
}
:where([data-ui="unified"][data-form="printable"]) .signed-icon { font-size: 2rem; color: var(--form-green); }
:where([data-ui="unified"][data-form="printable"]) .signed-title { margin: var(--space-2) 0; font-size: 1.2rem; }
:where([data-ui="unified"][data-form="printable"]) .signed-text { margin: 0 0 var(--space-3); font-size: 0.95rem; line-height: 1.5; }
:where([data-ui="unified"][data-form="printable"]) .signed-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-2); }

@media screen and (width <= 700px) {
    :where([data-ui="unified"][data-form="printable"]) .info-field--wide { grid-column: auto; }
    :where([data-ui="unified"][data-form="printable"]) .staff-send-panel { width: calc(100% - var(--space-6)); margin-block-end: 0; }
    :where([data-ui="unified"][data-form="printable"]) .staff-send-actions .toolbar-btn { flex: 1 1 auto; justify-content: center; }
    :where([data-ui="unified"][data-form="printable"]) .sign-btn { width: 100%; justify-content: center; }
    :where([data-ui="unified"][data-form="printable"]) .sig-pad-wrap { height: 150px; }
}

@media print {
    /* The clauses flow across the page break (one clause never splits); the signature block stays together. */
    :where([data-ui="unified"][data-form="printable"]) .waiver-box { break-inside: auto; }
    :where([data-ui="unified"][data-form="printable"]) .waiver-terms li { break-inside: avoid; }
    :where([data-ui="unified"][data-form="printable"]) .sig-pad-wrap { height: 1.1in; border-width: 1px; }
    :where([data-ui="unified"][data-form="printable"]) .sig-section { break-inside: avoid; }
    :where([data-ui="unified"][data-form="printable"]) .sig-consent { border: 0; padding: 0; margin-top: var(--space-3); }
    :where([data-ui="unified"][data-form="printable"]) .waiver-terms { font-size: 0.8rem; }
    :where([data-ui="unified"][data-form="printable"]) .waiver-esign { font-size: 0.8rem; }
}
}
