.custom-form-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.custom-form .form-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.custom-form .form-description {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 2rem;
}

.custom-form .form-field {
    margin-bottom: 1.5rem;
}

.custom-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-size: 0.875rem;
}

.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form input[type="date"],
.custom-form input[type="file"],
.custom-form select,
.custom-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #ffffff;
}

.custom-form input:focus,
.custom-form select:focus,
.custom-form textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.custom-form textarea {
    min-height: 120px;
    resize: vertical;
}

.custom-form fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.custom-form legend {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-size: 0.875rem;
}

.custom-form .radio-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.custom-form input[type="radio"] {
    margin-right: 0.5rem;
    width: auto;
}

.custom-form .signature-pad {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    background: #f7fafc;
}

.custom-form .signature-pad canvas {
    width: 100%;
    height: 150px;
    border: 1px dashed #cbd5e0;
    border-radius: 4px;
    background: white;
    cursor: crosshair;
}

.custom-form .signature-pad .clear-signature {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.custom-form .signature-pad .clear-signature:hover {
    background: #c53030;
}

.custom-form .form-actions {
    margin-top: 2rem;
}

.custom-form .submit-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-form .submit-button:hover {
    background: #3182ce;
}

.custom-form .submit-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.custom-form .form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.custom-form .form-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.custom-form .form-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.custom-form .field-error {
    color: #e53e3e;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.custom-form input.error,
.custom-form select.error,
.custom-form textarea.error {
    border-color: #e53e3e;
}

/* Tablet and below */
@media (max-width: 768px) {
    .custom-form-container {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 6px;
    }

    .custom-form .form-title {
        font-size: 1.5rem;
    }

    .custom-form input[type="text"],
    .custom-form input[type="email"],
    .custom-form input[type="tel"],
    .custom-form input[type="date"],
    .custom-form input[type="file"],
    .custom-form select,
    .custom-form textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .custom-form .signature-pad canvas {
        height: 120px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .custom-form-container {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 4px;
    }

    .custom-form .form-title {
        font-size: 1.25rem;
    }

    .custom-form .form-description {
        font-size: 0.875rem;
    }

    .custom-form .submit-button {
        padding: 1rem;
        font-size: 1rem;
    }

    .custom-form fieldset {
        margin: 0;
    }

    .custom-form .radio-label {
        padding: 0.5rem 0;
    }
}
