/* Base styles for Inkless-Flow e-Signature Tool */

/* Reset and general styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    background-color: #2563eb;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 28px;
}

header p {
    margin: 5px 0 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 20px;
}

/* Step indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    padding: 0 10px;
}

.step-indicator::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e2e8f0;
    z-index: 1;
}

.step-item {
    position: relative;
    text-align: center;
    z-index: 2;
    background-color: #f5f7fa;
    padding: 0 10px;
    font-size: 14px;
    color: #64748b;
    cursor: default;
}

.step-item::before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    background-color: #e2e8f0;
    border-radius: 50%;
    margin: 0 auto 5px;
    line-height: 30px;
    color: white;
}

.step-item.active {
    color: #2563eb;
    font-weight: 500;
}

.step-item.active::before {
    background-color: #2563eb;
}

.step-item.completed {
    color: #10b981;
}

.step-item.completed::before {
    background-color: #10b981;
}

.step-item:nth-child(1)::before { content: '1'; }
.step-item:nth-child(2)::before { content: '2'; }
.step-item:nth-child(3)::before { content: '3'; }
.step-item:nth-child(4)::before { content: '4'; }
.step-item:nth-child(5)::before { content: '5'; }
.step-item:nth-child(6)::before { content: '6'; }
.step-item:nth-child(7)::before { content: '7'; }
.step-item:nth-child(8)::before { content: '8'; }

/* Step content */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #334155;
}

input[type="text"],
input[type="email"],
input[type="date"],
textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

/* File upload area */
.file-input-container {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f8fafc;
    margin-bottom: 20px;
}

.file-input-container:hover,
.file-input-container.drag-active {
    border-color: #2563eb;
    background-color: #f0f9ff;
}

.file-input-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #64748b;
}

.file-input-text {
    color: #334155;
    margin-bottom: 5px;
}

.file-name {
    font-size: 14px;
    padding: 10px;
    background-color: #f1f5f9;
    border-radius: 4px;
    margin-bottom: 20px;
    word-break: break-all;
    display: none;
}

/* Preview containers */
.preview-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #f8fafc;
    min-height: 200px;
    overflow-y: auto;
    max-height: 500px;
}

/* Button styles */
.btn {
    display: inline-block;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #1d4ed8;
}

.btn-danger {
    background-color: #ef4444;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: #10b981;
}

.btn-success:hover {
    background-color: #059669;
}

/* Override button styles for disabled state */
.btn:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background-color: #cbd5e0;
}

/* Signature canvas with transparent background and grid */
#signature-canvas {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    margin-bottom: 10px;
    cursor: crosshair;
    touch-action: none;
    width: 100%;
    max-width: 600px;
}

/* Signature display area with checkered background */
.signature-box {
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    padding: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
    margin-bottom: 20px;
    /* Checkered background to show transparency */
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.signature-box img {
    max-width: 100%;
    max-height: 80px;
    background-color: transparent !important;
}

/* Custom field styles */
.custom-field-list {
    margin-top: 20px;
}

.custom-field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: #f8fafc;
}

/* Document pages */
.document-page {
    position: relative;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-number {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* Field containers */
.field-container {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.2) !important; /* More transparent */
    border: 2px solid #3b82f6;
    border-radius: 4px;
    padding: 5px;
    min-width: 150px;
    min-height: 60px;
    cursor: move;
    z-index: 10;
}

/* Make signature & image field containers even more transparent */
.field-container[id^="signature-field-"],
.field-container[id^="image-field-"] {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.field-container.draft {
    border-style: dashed;
}

.field-container.verified {
    border-style: solid;
    border-color: #10b981;
}

.field-label {
    font-size: 12px;
    color: #334155;
    margin-bottom: 4px;
    font-weight: 500;
}

.field-content {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Field content transparent backgrounds */
.field-content img {
    background-color: transparent !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.field-controls {
    position: absolute;
    top: -20px;
    right: 0;
    display: flex;
}

.field-control-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: #3b82f6;
    color: white;
    cursor: pointer;
    margin-left: 5px;
    border-radius: 50%;
    font-size: 12px;
}

.field-control-btn.remove-btn,
.field-control-btn.delete-btn {
    background-color: #ef4444;
}

.field-control-btn.place-btn {
    background-color: #10b981;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #3b82f6;
    border-radius: 50%;
}

.resize-handle.top-left {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.resize-handle.top-right {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.resize-handle.bottom-left {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
}

.resize-handle.bottom-right {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

/* Context menu */
.context-menu {
    position: absolute;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 5px 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    color: #334155;
    transition: background-color 0.1s;
}

.context-menu-item:hover {
    background-color: #f1f5f9;
}

/* Document area layout */
.document-area {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.document-preview {
    flex: 3;
    min-width: 300px;
}

.signature-area {
    flex: 1;
    min-width: 250px;
}

.drag-info {
    margin: 15px 0;
    padding: 10px;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    font-size: 14px;
    color: #0369a1;
}

/* Alert styles */
.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-success {
    background-color: #ecfdf5;
    color: #064e3b;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background-color: #fffbeb;
    color: #78350f;
    border: 1px solid #fde68a;
}

.alert-danger {
    background-color: #fef2f2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

/* Page navigation */
.page-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px;
    gap: 15px;
}

.page-navigation .btn {
    padding: 5px 10px;
    font-size: 14px;
}

.page-indicator {
    font-size: 14px;
    color: #64748b;
}

/* eIDAS Verification Badge */
.eidas-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: #0369a1;
    margin: 10px 0;
}

.eidas-badge::before {
    content: "✓";
    font-weight: bold;
    color: #0284c7;
    margin-right: 5px;
}

/* Verification Status Indicators */
.verification-status {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 8px;
    border-radius: 4px;
}

.verification-status.success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.verification-status.warning {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    color: #854d0e;
}

.verification-status.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.verification-status::before {
    margin-right: 8px;
    font-size: 16px;
}

.verification-status.success::before {
    content: "✓";
}

.verification-status.warning::before {
    content: "⚠";
}

.verification-status.error::before {
    content: "✕";
}

/* OTP Verification */
.otp-input {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.otp-input input {
    width: 40px;
    height: 50px;
    text-align: center;
    font-size: 18px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.otp-input input:focus {
    border-color: #4299e1;
    outline: none;
}

/* Loading Spinner for Verification */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Signature Information Panel */
.signature-info-panel {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.signature-info-panel h3 {
    color: #0369a1;
    margin-top: 0;
}

.signature-info-row {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
}

.signature-info-row:last-child {
    border-bottom: none;
}

.signature-info-label {
    width: 120px;
    font-weight: 500;
    color: #64748b;
}

.signature-info-value {
    flex: 1;
    word-break: break-all;
}

.signature-info-value code {
    background-color: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* GDPR Privacy Notice */
.privacy-notice {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-size: 14px;
}

.privacy-notice h4 {
    color: #334155;
    margin-top: 0;
}

.privacy-notice ul {
    padding-left: 20px;
}

.privacy-notice li {
    margin-bottom: 5px;
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    color: #334155;
}

.modal-body {
    padding: 15px;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

/* Legal Agreement Checkbox */
.legal-agreement {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.legal-agreement h4 {
    margin-top: 0;
    color: #334155;
}

.legal-agreement .checkbox-container {
    display: flex;
    align-items: flex-start;
    margin-top: 10px;
}

.legal-agreement .checkbox-container input {
    margin-top: 4px;
    margin-right: 8px;
}

/* Footer with GDPR Notice */
.gdpr-footer {
    margin-top: 40px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

.gdpr-footer a {
    color: #2563eb;
    text-decoration: none;
}

.gdpr-footer a:hover {
    text-decoration: underline;
}

/* Security Information */
.security-info {
    display: flex;
    align-items: center;
    background-color: #f0f9ff;
    border-left: 4px solid #38bdf8;
    padding: 10px 15px;
    margin: 15px 0;
}

.security-info-icon {
    color: #0284c7;
    font-size: 20px;
    margin-right: 10px;
}

.security-info-text {
    font-size: 14px;
    color: #334155;
}

/* Signature Validity Banner */
.signature-validity-banner {
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.signature-validity-banner.valid {
    background-color: #ecfdf5;
    border: 1px solid #6ee7b7;
}

.signature-validity-banner.invalid {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
}

.signature-validity-icon {
    font-size: 20px;
    margin-right: 10px;
}

.signature-validity-banner.valid .signature-validity-icon {
    color: #059669;
}

.signature-validity-banner.invalid .signature-validity-icon {
    color: #b91c1c;
}

.signature-validity-text {
    flex: 1;
}

.signature-validity-text h4 {
    margin: 0 0 5px 0;
}

.signature-validity-text p {
    margin: 0;
    font-size: 14px;
}

/* Timestamp Badge */
.timestamp-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: #0369a1;
}

.timestamp-badge::before {
    content: "🕒";
    margin-right: 5px;
}

/* Data Privacy Settings */
.data-privacy-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.data-privacy-section h3 {
    margin-top: 0;
    color: #334155;
}

.privacy-option {
    margin: 10px 0;
}

.privacy-option label {
    display: flex;
    align-items: center;
}

.privacy-option input {
    margin-right: 10px;
}

.privacy-option-description {
    margin-left: 25px;
    font-size: 12px;
    color: #64748b;
}

/* Checkbox overrides for privacy and legal notices */
.checkbox-container {
    display: flex;
    align-items: flex-start;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 4px;
}

/* OTP verification container styles */
#otp-verification-container {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
}

#otp-verification-container h3 {
    color: #0369a1;
    margin-top: 0;
}

#otp-input {
    letter-spacing: 2px;
    font-family: monospace;
    text-align: center;
}

/* Signature information section for step 8 */
.signature-info-section {
    text-align: left;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.signature-info-section table {
    width: 100%;
    border-collapse: collapse;
}

.signature-info-section td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.signature-info-section tr:last-child td {
    border-bottom: none;
}

.signature-info-section code {
    background-color: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Loading indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    font-size: 18px;
    color: #333;
}

.drag-active {
    background-color: #f0f9ff !important;
    border-color: #3498db !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .document-area {
        flex-direction: column;
    }
    
    .step-indicator {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
    }
    
    .step-item {
        flex: 0 0 auto;
        margin-right: 20px;
    }
    
    .step-indicator::after {
        display: none;
    }
    
    .card {
        padding: 15px;
    }
    
    #signature-canvas {
        max-width: 100%;
    }
}


/* Mobile specific styles */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="date"],
    textarea {
        font-size: 16px; /* Prevent zoom on mobile */
    }
    
    .step-item {
        font-size: 12px;
    }
    
    .document-area {
        gap: 10px;
    }
    
    .field-container {
        min-width: 120px;
    }
}

