/* 
 * Styles for Positive Grid Company Statement Form
 * A clean, responsive design for form elements and signature pad
 */

/* Base Styles and Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Typography */
header {
    padding-top: 20px; /* Add space above the header */
}

h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 30px;
    color: #000;
}

p {
    margin-bottom: 15px;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-group {
    margin-bottom: 20px;
}

.legal-text {
    margin: 20px 0;
    font-size: 18px;
    text-align: left;
}

/* Form Controls */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus {
    border-color: #4a90e2;
    outline: none;
}

input:required {
    background-color: #fff;
    background-image: linear-gradient(to right, #fff 99%, #ff0000 1%);
    background-repeat: no-repeat;
}

/* Error styling */
input.error {
    border-color: #ff0000;
    background-color: #fff0f0;
}

/* Specific styling for character validation errors */
input[data-error-type="character"] {
    border-color: #ff0000;
    background-color: #fff0f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23ff0000' d='M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6z'/%3E%3Cpath fill='%23ff0000' d='M8 4c-.6 0-1 .4-1 1v3c0 .6.4 1 1 1s1-.4 1-1V5c0-.6-.4-1-1-1z'/%3E%3Ccircle fill='%23ff0000' cx='8' cy='11' r='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    padding-right: 30px;
}

/* Position the form-group as relative */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

/* Style for the tooltip */
#character-tooltip {
    background: #333;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Read-only field styling */
.readonly-field {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-color: #ddd;
}

.readonly-field:focus {
    outline: none;
    border-color: #ddd;
}

/* Signature Pad */
.signature-container {
    margin-top: 10px;
    margin-bottom: 10px;
    position: relative;
}

#signatureCanvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: crosshair;
    width: 100%;
    max-width: 400px;
    height: 200px;
}

.signature-controls {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background-color: #3a7bc8;
}

.btn-secondary {
    background-color: #f1f1f1;
    color: #333;
    margin-top: 10px;
}

.btn-secondary:hover {
    background-color: #e1e1e1;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

/* Footer */
footer {
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    color: #777;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    #signatureCanvas {
        height: 150px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    input[type="text"],
    input[type="date"] {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Print Styles for PDF Generation */
@media print {
    body {
        background-color: #fff;
        padding: 0;
        font-size: 12pt;
    }
    
    .container {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    
    .btn, 
    #clearSignature {
        display: none;
    }
    
    input[type="text"],
    input[type="date"] {
        border: none;
        padding: 0;
        border-bottom: 1px solid #000;
        border-radius: 0;
    }
    
    #signatureCanvas {
        border: none;
        border-bottom: 1px solid #000;
        border-radius: 0;
    }
    
    footer {
        display: none;
    }
}