/*
 * Custom CSS for the Clio Grow Contact Form
 * This code is scoped to ensure styles are only applied to the form itself.
 *
 * All rules are prefixed with 'form' to target elements specifically within
 * the form container and prevent "leaking" to other parts of the site.
 */

/* ==========================================================================
   Import Fonts and General Form Styling
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Reem+Kufi:wght@400..700&amp;display=swap');

/* Form container styling */
form {
    font-family: 'Segoe UI', sans-serif;
    background-color: #ffffff;
    border-top: 4px solid #D1AD7B;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 30px;
    line-height: 1.7;
    color: #062239;
    margin: 20px 0;
}

/* ==========================================================================
   Scoped Headings and Vertical Bar
   ========================================================================== */
form h1,
form h2,
form h3,
form h4,
form h5,
form h6 {
    font-family: 'Reem Kufi', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #062239;
    margin-bottom: 20px;
    position: relative;
    padding-left: 20px;
}

form h1::before,
form h2::before,
form h3::before,
form h4::before,
form h5::before,
form h6::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #009999, #D1AD7B);
}

/* ==========================================================================
   Scoped Form Elements
   ========================================================================== */

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #062239;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="url"],
form input[type="number"],
form input[type="password"],
form input[type="date"],
form select,
form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    color: #062239;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 15px;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="tel"]:focus,
form input[type="url"]:focus,
form input[type="number"]:focus,
form input[type="password"]:focus,
form input[type="date"]:focus,
form select:focus,
form textarea:focus {
    border-color: #009999;
    box-shadow: 0 0 0 3px rgba(0, 153, 153, 0.1);
    outline: none;
}

form textarea {
    height: 120px;
    resize: vertical;
    min-height: 80px;
}

form select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23062239' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
}

form button[type="submit"],
form input[type="submit"],
form .submit-button,
form .btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background-color: #009999;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    margin-top: 15px;
}

form button[type="submit"]:hover,
form input[type="submit"]:hover,
form .submit-button:hover,
form .btn-primary:hover {
    background-color: #0a3a5c;
    transform: translateY(-2px);
}

form .required::after,
form label.required::after {
    content: " *";
    color: #D1AD7B;
    font-weight: bold;
}

form .error,
form .invalid,
form input.error,
form input.invalid,
form select.error,
form select.invalid,
form textarea.error,
form textarea.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

form .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

form .success,
form input.success,
form select.success,
form textarea.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

form .form-group,
form .field-group,
form .form-field {
    margin-bottom: 20px;
}

form input[type="checkbox"],
form input[type="radio"] {
    width: auto;
    margin-right: 8px;
    accent-color: #009999;
}

form input[type="checkbox"] + label,
form input[type="radio"] + label {
    display: inline;
    margin-left: 5px;
    font-weight: 400;
}

form .description,
form .help-text,
form .field-description {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

form .form-col {
    flex: 1;
    min-width: 200px;
}

form .success-message,
form .form-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

form .submitting {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 768px) {
    form {
        padding: 20px;
        margin: 15px 0;
    }
    form h1,
    form h2,
    form h3,
    form h4,
    form h5,
    form h6 {
        font-size: 24px;
    }
    form .form-row {
        flex-direction: column;
    }
    form .form-col {
        min-width: 100%;
    }
}

form div {
    box-sizing: border-box;
}

form p {
    font-family: 'Segoe UI', sans-serif;
    color: #062239;
    line-height: 1.7;
}