/* KERTANEXA_V15_25_3_WATERMARK_PREVIEW_OUTPUT_PARITY */
.pdf-stamp-container { max-width: 980px; }
.pdf-stamp-workspace { display: grid; gap: 18px; }
.pdf-stamp-options {
    border: 1px solid #dbe3f0;
    border-radius: 18px;
    background: #fbfdff;
    padding: 20px;
    display: grid;
    gap: 18px;
}
.pdf-stamp-options-head h2 { margin: 5px 0 0; font-size: clamp(1.08rem, 3vw, 1.35rem); color: #263a60; }
.pdf-stamp-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pdf-stamp-options .form-field { display: grid; gap: 7px; min-width: 0; }
.pdf-stamp-options .form-field > span,
.pdf-stamp-control-label,
.pdf-stamp-page-selection legend { font-size: .84rem; font-weight: 700; color: #354867; }
.pdf-stamp-options input[type="text"],
.pdf-stamp-options input[type="number"],
.pdf-stamp-options select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd6e6;
    border-radius: 11px;
    background: #fff;
    color: #243551;
    padding: 10px 12px;
}
.pdf-stamp-options input:focus-visible,
.pdf-stamp-options select:focus-visible,
.pdf-stamp-color-swatch:focus-visible { outline: 3px solid rgba(35, 92, 181, .2); border-color: #235cb5; }
.pdf-stamp-options input.is-invalid { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }
.pdf-stamp-text-field { grid-column: 1 / -1; }
.pdf-stamp-page-selection {
    margin: 0;
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    padding: 15px;
    display: grid;
    grid-template-columns: auto auto minmax(220px, 1fr);
    align-items: end;
    gap: 12px 18px;
}
.pdf-stamp-page-selection legend { padding: 0 6px; }
.pdf-stamp-page-selection > label:not(.form-field) { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #41516b; }
.pdf-stamp-range-field.is-disabled { opacity: .58; }
.pdf-stamp-opacity-field input[type="range"] { width: 100%; accent-color: #235cb5; }
.pdf-stamp-opacity-field output { float: right; color: #235cb5; }
.pdf-stamp-opacity-field small { color: #71809a; line-height: 1.45; }

.pdf-stamp-color-picker {
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    background: #fff;
    padding: 15px;
    display: grid;
    gap: 12px;
}
.pdf-stamp-color-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pdf-stamp-color-swatch {
    --swatch-color: #1e5aa8;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--swatch-color);
    box-shadow: 0 0 0 1px #bdc9da;
    display: inline-grid;
    place-items: center;
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: transform .15s ease, box-shadow .15s ease;
}
.pdf-stamp-color-swatch:hover { transform: translateY(-1px); }
.pdf-stamp-color-check {
    width: 8px;
    height: 14px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    opacity: 0;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.4));
}
.pdf-stamp-color-swatch.is-selected { box-shadow: 0 0 0 3px #dce9ff, 0 0 0 5px #235cb5; }
.pdf-stamp-color-swatch.is-selected .pdf-stamp-color-check { opacity: 1; }
.pdf-stamp-color-swatch.is-light .pdf-stamp-color-check { border-color: #243551; filter: none; }
.pdf-stamp-color-lock {
    width: 34px;
    height: 34px;
    border: 1px dashed #b8c5d8;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #f5f7fb;
    color: #53647f;
}
.pdf-stamp-color-lock svg { width: 17px; height: 17px; display: block; }
.pdf-stamp-custom-color { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(160px, 1fr); gap: 12px; align-items: end; }
.pdf-stamp-native-color input[type="color"] {
    width: 100%;
    height: 44px;
    border: 1px solid #cbd6e6;
    border-radius: 11px;
    background: #fff;
    padding: 5px;
    cursor: pointer;
}
.pdf-stamp-premium-note { margin: 0; color: #6d7890; font-size: .82rem; line-height: 1.5; }

.pdf-stamp-fixed-color-note,
.pdf-stamp-opacity-note {
    margin: 0;
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    background: #f7faff;
    color: #52647f;
    padding: 11px 13px;
    font-size: .84rem;
    line-height: 1.5;
}
.pdf-stamp-fixed-color-note strong,
.pdf-stamp-opacity-note strong { color: #263a60; }

.pdf-stamp-live-preview {
    position: relative;
    min-height: 118px;
    border: 1px solid #d8e2f1;
    border-radius: 15px;
    background: linear-gradient(145deg, #f8fbff, #eef4fd);
    padding: 38px 18px 18px;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.pdf-stamp-preview-label {
    position: absolute;
    top: 12px;
    left: 14px;
    color: #667995;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.pdf-stamp-live-preview > strong { font-size: 1.35rem; color: #1e5aa8; text-align: center; line-height: 1.35; }
.pdf-stamp-live-preview > small { width: 100%; margin-top: 8px; text-align: center; color: #71809a; line-height: 1.45; }
.pdf-stamp-preview-paper {
    width: min(100%, 560px);
    min-height: 150px;
    border: 1px solid #d8dde7;
    border-radius: 9px;
    background:
        linear-gradient(#eef1f6 1px, transparent 1px) 0 24px / 100% 26px,
        #fff;
    box-shadow: 0 9px 24px rgba(35, 64, 111, .09);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.pdf-stamp-preview-paper span {
    display: inline-block;
    max-width: 90%;
    font-size: 22px;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
    transform-origin: center;
}

.pdf-stamp-summary {
    border-radius: 12px;
    background: #edf4ff;
    color: #2d4c78;
    padding: 12px 14px;
    font-size: .88rem;
    line-height: 1.55;
}
.pdf-stamp-submit { justify-self: start; min-width: 230px; }
.pdf-stamp-submit.is-loading { cursor: wait; opacity: .8; }
.pdf-stamp-submit.is-loading::after {
    content: "";
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kx-stamp-spin .75s linear infinite;
}
@keyframes kx-stamp-spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
    .pdf-stamp-options { padding: 16px; border-radius: 15px; }
    .pdf-stamp-option-grid { grid-template-columns: 1fr; }
    .pdf-stamp-page-selection { grid-template-columns: 1fr; align-items: stretch; }
    .pdf-stamp-page-selection > label:not(.form-field) { min-height: 34px; }
    .pdf-stamp-custom-color { grid-template-columns: 1fr; }
    .pdf-stamp-color-swatch { width: 38px; height: 38px; }
    .pdf-stamp-live-preview { min-height: 130px; padding-inline: 12px; }
    .pdf-stamp-preview-paper { min-height: 170px; }
    .pdf-stamp-submit { width: 100%; min-width: 0; }
}


/* Preview canvas uses the exact raster stamp embedded into the output PDF. */
.pdf-stamp-preview-paper.has-watermark-canvas {
    min-height: 190px;
    padding: 12px;
    place-items: center;
}
.pdf-stamp-preview-paper canvas[data-watermark-preview-canvas] {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #e1e6ee;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(35, 64, 111, .08);
}
@media (max-width: 720px) {
    .pdf-stamp-preview-paper.has-watermark-canvas { min-height: 230px; }
}
