/**
 * HRM Form Overlay Styles
 */

.hrm-official-form-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hrm-form-header {
    background: #1e3a5f;
    color: #fff;
    padding: 20px 25px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.hrm-form-header h2 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.hrm-form-header p {
    margin: 5px 0 0;
    font-size: 13px;
    opacity: 0.85;
    color: #fff;
}

.hrm-form-badge {
    background: #fff;
    color: #1e3a5f;
    font-weight: 700;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hrm-form-notice {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #78350f;
}

.hrm-form-notice strong {
    display: block;
    margin-bottom: 4px;
}

/* Page container */
#hrm-form-overlay {
    position: relative;
    background: #f3f4f6;
    padding: 15px;
    border: 1px solid #d1d5db;
}

.hrm-form-page {
    display: none;
    position: relative;
}

.hrm-form-page.active {
    display: block;
}

/* The form background image */
.hrm-form-image-container {
    position: relative;
    display: inline-block;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hrm-form-bg-image {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Overlay fields positioned absolutely over the image */
.hrm-overlay-field {
    position: absolute;
    z-index: 10;
}

.hrm-overlay-field input[type="text"],
.hrm-overlay-field input[type="email"],
.hrm-overlay-field input[type="date"],
.hrm-overlay-field select {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(59, 130, 246, 0.5);
    background: rgba(239, 246, 255, 0.7);
    padding: 1px 4px;
    font-size: 11px;
    font-family: Arial, sans-serif;
    color: #111;
    box-sizing: border-box;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.hrm-overlay-field input[type="text"]:focus,
.hrm-overlay-field input[type="email"]:focus,
.hrm-overlay-field input[type="date"]:focus,
.hrm-overlay-field select:focus {
    border-color: #3b82f6;
    background: rgba(219, 234, 254, 0.85);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.hrm-overlay-field.hrm-field-error input,
.hrm-overlay-field.hrm-field-error select {
    border-color: #ef4444 !important;
    background: rgba(254, 226, 226, 0.8) !important;
}

/* Signature field */
.hrm-signature-wrapper {
    width: 100%;
    height: 100%;
    background: rgba(239, 246, 255, 0.7);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hrm-signature-canvas {
    flex: 1;
    cursor: crosshair;
    width: 100%;
    background: transparent;
}

.hrm-sig-label {
    font-size: 9px;
    color: #6b7280;
    padding: 1px 4px;
    background: rgba(255,255,255,0.8);
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.hrm-clear-sig {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(239,68,68,0.8);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 9px;
    padding: 1px 5px;
    cursor: pointer;
    z-index: 20;
}

.hrm-sig-error .hrm-signature-wrapper {
    border-color: #ef4444 !important;
    background: rgba(254, 226, 226, 0.5) !important;
}

/* Radio / checkbox overlays */
.hrm-overlay-radio-item,
.hrm-overlay-checkbox-item {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
}

.hrm-overlay-radio-item input[type="radio"],
.hrm-overlay-checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #1e3a5f;
    margin: 0;
}

/* Page navigation */
.hrm-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
}

.hrm-page-nav button {
    background: #1e3a5f;
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.hrm-page-nav button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

#hrm-page-indicator {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    min-width: 100px;
    text-align: center;
}

/* Submit section */
.hrm-form-submit-section {
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.hrm-submit-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.hrm-submit-btn:hover {
    background: #15803d;
}

.hrm-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.hrm-cancel-btn {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-left: 10px;
}

.hrm-form-error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 10px 15px;
    margin: 10px 0;
    color: #991b1b;
    font-size: 13px;
    border-radius: 0 4px 4px 0;
    display: none;
}

/* Success message */
.hrm-form-success {
    background: #f0fdf4;
    border: 2px solid #16a34a;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    display: none;
}

.hrm-form-success h3 {
    color: #15803d;
    font-size: 22px;
    margin: 0 0 10px;
}

.hrm-form-success p {
    color: #374151;
    margin: 0 0 20px;
}

/* Instructions box */
.hrm-form-instructions {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #1e40af;
}

.hrm-form-instructions ol {
    margin: 5px 0 0 18px;
    padding: 0;
}

.hrm-form-instructions li {
    margin-bottom: 3px;
}

/* Forms list */
.hrm-forms-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.hrm-form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    transition: box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.hrm-form-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #3b82f6;
    text-decoration: none;
    color: inherit;
}

.hrm-form-card-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrm-form-card-badge.pa-clearance {
    background: #dcfce7;
    color: #15803d;
}

.hrm-form-card-badge.pennsylvania {
    background: #fef3c7;
    color: #92400e;
}

.hrm-form-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: #111827;
}

.hrm-form-card p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.hrm-form-card-status {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
}

.hrm-form-card-status.submitted {
    color: #16a34a;
}

.hrm-form-card-status.pending {
    color: #d97706;
}

.hrm-form-card-status.not-submitted {
    color: #6b7280;
}

/* Category headers */
.hrm-forms-category {
    margin: 25px 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.hrm-forms-category h3 {
    margin: 0;
    font-size: 16px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .hrm-forms-library {
        grid-template-columns: 1fr;
    }

    .hrm-overlay-field input[type="text"],
    .hrm-overlay-field input[type="email"],
    .hrm-overlay-field input[type="date"],
    .hrm-overlay-field select {
        font-size: 9px;
        padding: 0 2px;
    }
}
