/*
 * Checkout signing block (sipdfsign 1.1.0).
 * No web fonts: Alex Brush is bundled in Assets/public/fonts and loaded with
 * @font-face (the PDF uses the same file), everything else is the system stack.
 * Tokens follow the sibooking admin design system; --sipdf-accent is set inline
 * from the Calendar Styler accent when sibooking is active.
 */
@font-face {
    font-family: "SI Alex Brush";
    src: url("../fonts/AlexBrush-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.sipdf-card {
    --sipdf-accent: #0274be;
    --sipdf-ink: #1c2129;
    --sipdf-ink-2: #545b65;
    --sipdf-ink-3: #837d74;
    --sipdf-line: #e6e1d9;
    --sipdf-line-strong: #cfc8bd;
    --sipdf-surface: #ffffff;
    --sipdf-surface-2: #faf8f5;
    --sipdf-ok: #1e6b4a;
    --sipdf-ok-bg: #e5f2ea;
    --sipdf-crit: #a62a1f;
    --sipdf-crit-bg: #fbeae7;
    --sipdf-radius: 12px;
    --sipdf-script: "SI Alex Brush", "Brush Script MT", cursive;
    box-sizing: border-box;
    margin: 28px 0 8px;
    padding: 22px 22px 18px;
    background: var(--sipdf-surface);
    border: 1px solid var(--sipdf-line);
    border-radius: var(--sipdf-radius);
    box-shadow: 0 1px 2px rgba(28, 33, 41, .05), 0 10px 28px -14px rgba(28, 33, 41, .22);
    color: var(--sipdf-ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.sipdf-card *, .sipdf-card *::before, .sipdf-card *::after { box-sizing: border-box; }
.sipdf-card.has-error { border-color: var(--sipdf-crit); box-shadow: 0 0 0 3px var(--sipdf-crit-bg); }
.sipdf-card.is-signed { border-color: color-mix(in srgb, var(--sipdf-accent) 45%, var(--sipdf-line)); }

.sipdf-card__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.sipdf-card__icon {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--sipdf-accent) 12%, #fff);
    color: var(--sipdf-accent);
}
.sipdf-card__title { margin: 0 0 2px; font-size: 1.15em; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.sipdf-card__sub { margin: 0; color: var(--sipdf-ink-2); font-size: .93em; }
.sipdf-card__sub a { color: var(--sipdf-accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

/* segmented control */
.sipdf-tabs {
    display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px;
    background: var(--sipdf-surface-2); border: 1px solid var(--sipdf-line); border-radius: 999px;
}
.sipdf-tab {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    margin: 0; padding: 8px 16px; border-radius: 999px;
    font: inherit; font-size: .9em; font-weight: 600; line-height: 1.2; color: var(--sipdf-ink-2);
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.sipdf-tab:hover { color: var(--sipdf-ink); }
.sipdf-tab:focus-visible { outline: 2px solid var(--sipdf-accent); outline-offset: 2px; }
.sipdf-tab.sicurrent { background: var(--sipdf-surface); color: var(--sipdf-ink); box-shadow: 0 1px 2px rgba(28, 33, 41, .12); }
.sipdf-tabs--single .sipdf-tab { cursor: default; }

.sisigwrapper { border: 0; padding: 0; }

.sipdf-label { display: block; font-size: .85em; font-weight: 600; color: var(--sipdf-ink-2); margin: 0 0 6px; }
.sipdf-input {
    width: 100%; max-width: 520px; padding: 11px 14px;
    border: 1px solid var(--sipdf-line-strong); border-radius: 8px;
    font: inherit; font-size: 1em; color: var(--sipdf-ink); background: var(--sipdf-surface);
}
.sipdf-input:focus { outline: 0; border-color: var(--sipdf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sipdf-accent) 18%, transparent); }

/* the "sign here" pad, shared by draw and typed preview */
.sipdf-pad {
    position: relative; width: 100%; max-width: 520px; height: 170px; margin-top: 12px;
    background: var(--sipdf-surface);
    background-image: linear-gradient(var(--sipdf-line-strong), var(--sipdf-line-strong));
    background-repeat: no-repeat; background-size: calc(100% - 40px) 1px; background-position: 20px calc(100% - 40px);
    border: 1.5px dashed var(--sipdf-line-strong); border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s ease;
}
.sipdf-pad--draw { cursor: crosshair; touch-action: none; }
.sipdf-pad--draw:hover, .sipdf-pad--draw:focus-within { border-color: var(--sipdf-accent); }
.sipdf-pad__x { position: absolute; inset-inline-start: 16px; bottom: 34px; font-size: 20px; color: var(--sipdf-ink-3); pointer-events: none; }
.sipdf-pad__hint {
    position: absolute; left: 0; right: 0; bottom: 12px; text-align: center;
    font-size: .78em; letter-spacing: .04em; text-transform: uppercase; color: var(--sipdf-ink-3);
    pointer-events: none; transition: opacity .2s ease;
}
#sicanvas {
    display: block; width: 100%; height: 100%; max-width: none;
    background: transparent; position: relative; z-index: 1; cursor: crosshair; touch-action: none;
}
.sipdf-typed, #sitextsignature {
    position: absolute; inset-inline-start: 40px; inset-inline-end: 20px; bottom: 44px;
    font-family: var(--sipdf-script); font-size: 42px; line-height: 1;
    color: var(--sipdf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: transparent; width: auto; height: auto; margin: 0; padding: 0;
}
.sipdf-pad--typed .sipdf-pad__hint { opacity: 1; }
.sipdf-pad--typed:has(.sipdf-typed.is-on) .sipdf-pad__hint { opacity: 0; }

.sipdf-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 520px; margin-top: 10px; }
.sipdf-actions__btns { display: inline-flex; gap: 8px; }
.sipdf-status { font-size: .85em; font-weight: 600; color: var(--sipdf-ok); opacity: 0; transition: opacity .15s ease; }
.sipdf-status.is-on { opacity: 1; }
.sipdf-status.is-on::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-inline-end: 5px; vertical-align: -1px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E6B4A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat; }
.sipdf-btn, .sipdf-card button.sipdf-btn {
    appearance: none; margin: 0; padding: 7px 14px; cursor: pointer;
    background: var(--sipdf-surface); color: var(--sipdf-ink-2);
    border: 1px solid var(--sipdf-line-strong); border-radius: 8px;
    font: inherit; font-size: .85em; font-weight: 600; line-height: 1.2;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.sipdf-btn:hover, .sipdf-card button.sipdf-btn:hover { color: var(--sipdf-ink); border-color: var(--sipdf-ink-3); background: var(--sipdf-surface-2); }
.sipdf-btn:focus-visible { outline: 2px solid var(--sipdf-accent); outline-offset: 2px; }

/* consent */
.sipdf-consent {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 18px 0 0; padding: 12px 14px;
    background: var(--sipdf-surface-2); border: 1px solid var(--sipdf-line); border-radius: 10px;
    font-size: .9em; line-height: 1.45; color: var(--sipdf-ink); cursor: pointer;
}
.sipdf-consent input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--sipdf-accent); }
.sipdf-card.has-error .sipdf-consent { border-color: var(--sipdf-crit-line, #efb7ae); }
.sipdf-trust { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: .78em; color: var(--sipdf-ink-3); }
.sipdf-trust svg { flex: 0 0 auto; color: var(--sipdf-ok); }

/* legacy hooks other code may still target */
.sibysigning { margin-top: 25px; }

/* terms modal */
.simodal {
    display: none; position: fixed; z-index: 100001; inset: 0;
    background: rgba(28, 33, 41, .55); backdrop-filter: blur(2px);
    padding: 24px;
}
.simodal[hidden] { display: none !important; }
.simodal-content {
    position: relative; top: auto; left: auto; transform: none;
    width: min(760px, 100%); max-height: calc(100vh - 48px); margin: 4vh auto 0;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 14px; padding: 0; overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
    color: #1c2129;
}
.simodal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e6e1d9; }
.simodal-head h3 { margin: 0; font-size: 1.05em; }
.simodal-body { padding: 18px 22px 22px; overflow: auto; font-size: .95em; line-height: 1.55; }
.siclose {
    position: static; float: none; appearance: none; border: 0; cursor: pointer;
    width: 34px; height: 34px; border-radius: 50%; background: #faf8f5;
    font-size: 24px; line-height: 1; color: #545b65; font-weight: 400; padding: 0;
}
.siclose:hover { background: #e6e1d9; color: #1c2129; }
body.sipdf-modal-open { overflow: hidden; }

/* signed-copy link on the order-received / view-order pages */
.sipdf-download { margin: 12px 0 0; }
.sipdf-download__link::before { content: "\2193\00a0"; }

@media (max-width: 600px) {
    .sipdf-card { padding: 16px 14px; }
    .sipdf-pad { height: 150px; }
    .sipdf-typed, #sitextsignature { font-size: 34px; }
    .sipdf-tab { padding: 8px 12px; }
}
