/**
 * Custom Signature - Form Styles
 */

/* Form wrapper */
.cs-signature-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 35px 40px !important;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Form element */
.cs-signature-form {
    padding: 10px 0;
}

/* Form title */
.cs-form-title {
    margin: 0 0 15px;
    font-size: 1.5em;
    font-weight: 600;
    color: #1838bd;
}

/* Form description */
.cs-form-description {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.6;
}

/* Form fields container */
.cs-form-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Individual field */
.cs-field {
    display: flex;
    flex-direction: column;
}

.cs-field label {
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

/* Required indicator */
.cs-required {
    color: #dc3545;
    font-weight: bold;
}

/* Input fields */
.cs-input,
.cs-signature-form input[type="text"],
.cs-signature-form input[type="email"],
.cs-signature-form input[type="tel"],
.cs-signature-form input[type="number"],
.cs-signature-form input[type="date"],
.cs-signature-form select,
.cs-signature-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}

.cs-input:focus,
.cs-signature-form input:focus,
.cs-signature-form select:focus,
.cs-signature-form textarea:focus {
    outline: none;
    border-color: #1838bd;
    box-shadow: 0 0 0 3px rgba(24, 56, 189, 0.15);
    background: #fff;
}

/* Textarea */
.cs-signature-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* Select */
.cs-signature-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
    background-color: #fafafa;
}

/* Checkbox */
.cs-field-checkbox {
    flex-direction: row;
    align-items: flex-start;
}

.cs-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.cs-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #1838bd;
}

.cs-checkbox-label span {
    font-weight: normal;
}

/* GDPR checkbox */
.cs-field-gdpr {
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cs-gdpr-label {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.cs-gdpr-label input[type="checkbox"] {
    margin-top: 3px;
}

/* Turnstile container */
.cs-turnstile-container {
    margin-top: 20px;
}

/* Submit button area */
.cs-form-submit {
    margin-top: 25px;
}

/* Submit button */
.cs-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 35px;
    background-color: #1838bd;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(24, 56, 189, 0.3);
}

.cs-submit-btn:hover {
    background-color: #132d96;
    box-shadow: 0 6px 16px rgba(24, 56, 189, 0.4);
}

.cs-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(24, 56, 189, 0.3);
}

.cs-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading spinner */
.cs-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: cs-spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes cs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages */
.cs-form-messages {
    margin-top: 25px;
    display: none;
}

.cs-message-success,
.cs-message-error {
    display: none;
}

.cs-message {
    padding: 18px 22px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cs-message::before {
    font-size: 20px;
    flex-shrink: 0;
}

.cs-message-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b1dfbb;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.cs-message-success::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
}

.cs-message-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

.cs-message-error::before {
    content: "✕";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
}

/* Error state for admin */
.cs-signature-form-error {
    padding: 18px 22px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
}

/* Responsive */
@media screen and (max-width: 480px) {
    .cs-signature-form-wrapper {
        padding: 25px 20px;
        margin: 0 10px;
    }

    .cs-submit-btn {
        width: 100%;
    }

    .cs-message {
        flex-direction: column;
        text-align: center;
    }
}
