/* PDF Sign Local Hybrid Tool Page Styles */
.pdf-sign-page {
    padding-bottom: 60px;
}

/* Hero Section Refinements */
.pdf-sign-page .tool-hero {
    border-bottom: 1px solid var(--border-soft);
    padding: 32px 0 28px;
    margin-bottom: 30px;
    background: var(--hero-bg, #ffffff);
}

.pdf-sign-page .tool-hero__main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.pdf-sign-page .tool-hero__copy h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin: 12px 0 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-sign-page .tool-hero__desc {
    font-size: 15px;
    color: var(--text-sub);
    line-height: 1.6;
    max-width: 680px;
    margin-bottom: 16px;
}

.pdf-sign-page .tool-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-sign-page .tool-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.pdf-sign-page .tool-hero__meta span i {
    color: #dc2626;
}

/* Side Tip Card */
.pdf-sign-page .tool-hero__aside {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    width: 280px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pdf-sign-page .tool-hero__aside strong {
    display: block;
    font-size: 14px;
    color: #dc2626;
    margin-bottom: 6px;
}

.pdf-sign-page .tool-hero__aside p {
    font-size: 13px;
    color: var(--text-sub);
    margin: 0;
    line-height: 1.5;
}

/* Upload Area & File Cards */
.pdf-sign-page .upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-sign-page .upload-area:hover,
.pdf-sign-page .upload-area.dragover {
    border-color: #dc2626;
    background: #fef2f2;
}

.pdf-sign-page .upload-content i {
    color: #ef4444;
    margin-bottom: 10px;
}

.pdf-sign-page .upload-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px;
}

.pdf-sign-page .upload-content p {
    font-size: 13px;
    color: var(--text-sub);
    margin: 0;
}

/* File Card */
.pdf-sign-page .pdf-file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pdf-sign-page .pdf-file-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pdf-sign-page .pdf-file-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.pdf-sign-page .pdf-file-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pdf-sign-page .pdf-file-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-all;
}

.pdf-sign-page .pdf-file-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-sub);
}

.pdf-sign-page .page-badge {
    background: #fef2f2;
    color: #dc2626;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Radio Options Pill */
.sign-options-pill {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.sign-option-item {
    flex: 1;
    cursor: pointer;
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 10px 12px;
    background: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sign-option-item:hover {
    border-color: #fca5a5;
    background: #f8fafc;
}

.sign-option-item.active {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.sign-option-item input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* Page Thumbnail Cards Grid */
.pdf-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.pdf-page-card {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.pdf-page-card:hover {
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.pdf-page-card .card-page-num {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 2;
}

.pdf-page-card .card-stamp-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pdf-page-card .card-canvas-wrap {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    cursor: pointer;
}

.pdf-page-card .card-canvas-wrap canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.pdf-page-card .card-action-btn {
    width: 100%;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Interactive Stamp Modal Editor */
.stamp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.stamp-modal-dialog {
    background: #ffffff;
    border-radius: 14px;
    width: 96%;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.stamp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-main);
    flex-shrink: 0;
}

.stamp-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stamp-modal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stamp-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #e2e8f0;
}

.stamp-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 44px 24px 30px 24px;
    overflow: auto;
    position: relative;
    user-select: none;
}

.stamp-canvas-stage {
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    background: #ffffff;
    margin: auto 0;
    flex-shrink: 0;
}

/* Interactive Floating Stamp Element */
.stamp-interact-elem {
    position: absolute;
    border: 2px dashed #dc2626;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
    cursor: move;
    user-select: none;
    touch-action: none;
    z-index: 10;
    transform-origin: center center;
    box-sizing: border-box;
}

.stamp-interact-elem canvas,
.stamp-interact-elem img {
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

/* Handles */
.stamp-handle-rotate {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: #dc2626;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.stamp-handle-rotate::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 8px;
    background: #dc2626;
}

.stamp-handle-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 2px solid #dc2626;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.stamp-handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.stamp-handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.stamp-handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.stamp-handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Modal Sidebar Controls - Compact & Neatly Formatted */
.stamp-modal-sidebar {
    width: 300px;
    background: #ffffff;
    border-left: 1px solid var(--border-main);
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stamp-modal-sidebar .sidebar-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.stamp-modal-sidebar .sidebar-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
}

.stamp-modal-sidebar .sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stamp-modal-sidebar .card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
}

.sign-options-pill-sidebar {
    display: flex;
    gap: 6px;
}

.sign-options-pill-sidebar .sign-option-item {
    flex: 1;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-main);
}

.sign-options-pill-sidebar .sign-option-item.active {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.sign-options-pill-sidebar .sign-option-item input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.stamp-modal-sidebar .sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.stamp-modal-sidebar .sidebar-section-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stamp-modal-sidebar .sidebar-form-group {
    margin-bottom: 0;
}

.stamp-modal-sidebar .slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 3px;
}

.stamp-modal-sidebar .slider-val-badge {
    background: #f1f5f9;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-family: Consolas, Monaco, monospace;
}

.stamp-modal-sidebar .sidebar-range {
    height: 22px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    box-shadow: none;
}

/* Perforated Sidebar Card */
.stamp-modal-sidebar .perf-sidebar-card {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.stamp-modal-sidebar .perf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stamp-modal-sidebar .perf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.stamp-modal-sidebar .perf-checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.stamp-modal-sidebar .perf-tag-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.stamp-modal-sidebar .sidebar-tip-box {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 6px;
    margin-top: auto;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.stamp-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--border-main);
}

/* Progress Panel */
.pdf-sign-page .wm-progress-container {
    background: #f8fafc;
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

.pdf-sign-page .wm-progress-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

/* Result Card */
.pdf-sign-page .wm-result-card {
    background: #ffffff;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.08);
}

.pdf-sign-page .wm-result-icon {
    width: 52px;
    height: 52px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

.pdf-sign-page .wm-result-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
}

.pdf-sign-page .wm-result-meta {
    font-size: 13.5px;
    color: var(--text-sub);
    margin-bottom: 18px;
}

.pdf-sign-page .btn-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    padding: 11px 26px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    transition: all 0.2s ease;
}

.pdf-sign-page .btn-download-pdf:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
    color: #ffffff;
    text-decoration: none;
}

/* Guide Table */
.pdf-sign-page .wm-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pdf-sign-page .wm-guide-table th {
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border-main);
    text-align: left;
}

.pdf-sign-page .wm-guide-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-sub);
    line-height: 1.5;
}

.pdf-sign-page .badge-wm {
    display: inline-block;
    padding: 3px 8px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}
