* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f6f3eb;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: #0c67fe;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logo {
    max-height: 240px;
    margin: 0 auto 20px auto;
    display: block;
    max-width: 800px;
    object-fit: contain;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.credit-form {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    position: relative;
}

.credit-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #0c67fe 0%, #3b82f6 50%, #0c67fe 100%);
}

.form-section {
    padding: 40px;
    border-bottom: 1px solid #e1e8ed;
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0c67fe 0%, transparent 100%);
}

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

.form-section h2 {
    color: #0c67fe;
    margin-bottom: 30px;
    font-size: 1.6em;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.form-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #0c67fe 0%, #3b82f6 100%);
    border-radius: 2px;
}

.form-section h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.section-note {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 20px;
}

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

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    letter-spacing: 0.025em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0c67fe;
    box-shadow: 0 0 0 3px rgba(12, 103, 254, 0.1), 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.reference-group {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    border-left: 4px solid #0c67fe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.signature-container {
    margin-bottom: 20px;
}

#signatureCanvas {
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: crosshair;
    display: block;
    margin: 10px 0;
    width: 100%;
    max-width: 500px;
    height: 200px;
}

.signature-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

#clearSignature {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#clearSignature:hover {
    background: #c0392b;
}

.signature-status {
    color: #7f8c8d;
    font-style: italic;
}

.signature-status.signed {
    color: #27ae60;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.checkbox-group:hover {
    border-color: #0c67fe;
    background: #f0f9ff;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.5;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 15px;
    margin-top: 3px;
    transform: scale(1.4);
    accent-color: #0c67fe;
}

.legal-section {
    background: #f8f9fa;
}

.legal-text {
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
}

.legal-text h3 {
    color: #2c3e50;
    margin: 20px 0 10px 0;
    font-size: 1.1em;
}

.legal-text h4 {
    color: #34495e;
    margin: 15px 0 8px 0;
    font-size: 1em;
}

.legal-text ul {
    margin: 10px 0 10px 20px;
}

.legal-text li {
    margin-bottom: 5px;
}

.form-actions {
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
}

.submit-btn {
    background: linear-gradient(135deg, #0c67fe 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(12, 103, 254, 0.25);
    letter-spacing: 0.025em;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(12, 103, 254, 0.35);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-message {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
    margin-top: 20px;
}

.success-message h2 {
    color: #2563eb;
    margin-bottom: 15px;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.field-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.3) !important;
}

.field-valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.error-text {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.success-text {
    color: #10b981;
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
    display: flex;
    align-items: center;
    animation: checkmark 0.3s ease-in;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-section {
        padding: 20px;
    }
    
    #signatureCanvas {
        width: 100%;
        max-width: none;
    }
    
    .signature-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 15px;
    }
}