/* ===== MVSC PDF Signer — Frontend ===== */

.mvsc-ps-wrap {
    max-width: 820px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    overflow: hidden;
}

/* Header */
.mvsc-ps-header {
    background: linear-gradient(135deg, #1a3a6e 0%, #2471a3 100%);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}
.mvsc-ps-header h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.mvsc-ps-header p  { margin: 0; font-size: 13px; opacity: 0.85; }
.mvsc-ps-logo { height: 50px; }

/* Progress */
.mvsc-ps-progress-wrap {
    height: 5px;
    background: #e9ecef;
}
.mvsc-ps-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2471a3, #1abc9c);
    transition: width 0.4s ease;
    width: 0%;
}
.mvsc-ps-page-indicator {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 6px 0 0;
    letter-spacing: 0.5px;
}

/* Viewer */
.mvsc-ps-viewer-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    overflow-x: auto;
    background: #525659;
    text-align: center;
    padding: 16px 0;
}

#mvsc-pdf-canvas {
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: #fff;
}

#mvsc-field-overlay {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}
#mvsc-field-overlay > * {
    position: absolute;
    pointer-events: all;
}

/* Read-only notice */
.mvsc-readonly-notice {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.92);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Field wrapper */
.mvsc-field-wrap {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mvsc-field-label {
    font-size: 9px;
    font-weight: 700;
    color: #2471a3;
    background: rgba(255,255,255,0.85);
    padding: 1px 3px;
    border-radius: 2px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    pointer-events: none;
}

/* Input styles */
.mvsc-ps-wrap input[type="text"],
.mvsc-ps-wrap input[type="date"],
.mvsc-ps-wrap textarea {
    border: 1.5px solid #2471a3 !important;
    border-radius: 3px !important;
    background: rgba(232, 244, 255, 0.75) !important;
    font-size: 13px;
    padding: 2px 5px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s;
}
.mvsc-ps-wrap input:focus,
.mvsc-ps-wrap textarea:focus {
    background: rgba(255,255,255,0.98) !important;
    border-color: #1a5276 !important;
    box-shadow: 0 0 0 2px rgba(36,113,163,0.2);
}

/* Initial input */
.mvsc-initial-input {
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-color: #e74c3c !important;
    background: rgba(255, 235, 235, 0.8) !important;
}
.mvsc-initial-input:focus {
    border-color: #c0392b !important;
}

/* Signature input */
.mvsc-signature-input {
    font-family: 'Georgia', 'Times New Roman', serif !important;
    font-size: 16px !important;
    font-style: italic !important;
    color: #1a3a6e !important;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #1a3a6e !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 2px 4px;
}

/* Radio buttons */
.mvsc-radio-btn {
    position: absolute;
    border: 2px solid #2471a3;
    border-radius: 50%;
    background: rgba(232,244,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #2471a3;
    transition: all 0.15s;
}
.mvsc-radio-btn:hover  { background: rgba(36,113,163,0.15); }
.mvsc-radio-btn.selected { background: #2471a3; color: #fff; }

/* Checkbox buttons */
.mvsc-checkbox-btn {
    position: absolute;
    border: 2px solid #2471a3;
    border-radius: 3px;
    background: rgba(232,244,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #2471a3;
    transition: all 0.15s;
}
.mvsc-checkbox-btn:hover   { background: rgba(36,113,163,0.15); }
.mvsc-checkbox-btn.selected { background: #2471a3; color: #fff; border-color: #1a5276; }

/* Navigation */
.mvsc-ps-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    gap: 12px;
}

.mvsc-ps-nav-pages {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.mvsc-nav-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dee2e6;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.mvsc-nav-dot:hover  { background: #adb5bd; }
.mvsc-nav-dot.done   { background: #1abc9c; color: #fff; }
.mvsc-nav-dot.active { background: #2471a3; color: #fff; transform: scale(1.15); }

/* Buttons */
.mvsc-btn {
    padding: 10px 24px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.mvsc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.mvsc-btn-primary   { background: #2471a3; color: #fff; }
.mvsc-btn-primary:hover:not(:disabled) { background: #1a5276; }

.mvsc-btn-secondary { background: #e9ecef; color: #555; }
.mvsc-btn-secondary:hover:not(:disabled) { background: #dee2e6; }

.mvsc-btn-submit {
    background: linear-gradient(135deg, #1e8449, #27ae60);
    color: #fff;
    padding: 14px 40px;
    font-size: 16px;
    border-radius: 8px;
}
.mvsc-btn-submit:hover:not(:disabled) { background: linear-gradient(135deg, #196f3d, #1e8449); }

/* Notices */
.mvsc-ps-notice {
    margin: 0 24px 16px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}
.mvsc-error   { background: #fff5f5; color: #c0392b; border: 1px solid #f5b7b1; }
.mvsc-success { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }

/* Submit / Download wrap */
.mvsc-ps-submit-wrap,
.mvsc-ps-download-wrap {
    text-align: center;
    padding: 20px 24px 24px;
    border-top: 1px solid #e9ecef;
}
.mvsc-submit-note {
    font-size: 12px;
    color: #888;
    margin: 0 0 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .mvsc-ps-header { padding: 16px 20px; }
    .mvsc-ps-nav    { padding: 12px 16px; }
    .mvsc-btn       { padding: 8px 14px; font-size: 13px; }
}
