/**
 * ABCS Doctor Contact Form Styles
 * 
 * Self-contained styling for the doctor profile contact form.
 * These styles work independently of theme styling.
 * Theme can override these styles if custom styling is desired.
 *
 * @package ABCS_Doctor_Forms
 */

/* ==========================================================================
   Form Wrapper
   ========================================================================== */

.doctor-contact-form-wrapper {
    padding: 20px;
    background-color: #f5f9fa;
    border-top: 4px solid #0073aa;
    border-radius: 0 0 4px 4px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.doctor-contact-form-wrapper *,
.doctor-contact-form-wrapper *::before,
.doctor-contact-form-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Form Title
   ========================================================================== */

.doctor-contact-form-wrapper .widget-title {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #1e3a5f;
    border-bottom: 1px solid #dce5e8;
    line-height: 1.3;
}

/* ==========================================================================
   Gravity Forms Reset & Base Styles
   ========================================================================== */

.doctor-contact-form-wrapper .gform_wrapper {
    margin: 0;
    padding: 0;
}

.doctor-contact-form-wrapper .gform_body {
    margin: 0;
    padding: 0;
}

.doctor-contact-form-wrapper .gform_fields {
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 8px 16px !important;
    row-gap: 8px !important;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.doctor-contact-form-wrapper .gfield {
    margin: 0 0 8px 0;
    padding: 0;
}

.doctor-contact-form-wrapper .gfield_label {
    display: block;
    margin: 0 0 5px 0;
    font-size: 0.875em;
    font-weight: 600;
    color: #333;
    text-transform: none;
}

.doctor-contact-form-wrapper .gfield_required {
    color: #c0392b;
    margin-left: 2px;
}

/* Text Inputs & Textareas */
.doctor-contact-form-wrapper input[type="text"],
.doctor-contact-form-wrapper input[type="email"],
.doctor-contact-form-wrapper input[type="tel"],
.doctor-contact-form-wrapper input[type="url"],
.doctor-contact-form-wrapper input[type="number"],
.doctor-contact-form-wrapper textarea,
.doctor-contact-form-wrapper select {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1em;
    font-family: inherit;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccd5d9;
    border-radius: 3px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.doctor-contact-form-wrapper input[type="text"]:focus,
.doctor-contact-form-wrapper input[type="email"]:focus,
.doctor-contact-form-wrapper input[type="tel"]:focus,
.doctor-contact-form-wrapper input[type="url"]:focus,
.doctor-contact-form-wrapper input[type="number"]:focus,
.doctor-contact-form-wrapper textarea:focus,
.doctor-contact-form-wrapper select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.doctor-contact-form-wrapper textarea {
    min-height: 120px;
    resize: vertical;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.doctor-contact-form-wrapper .gform_footer {
    margin: 20px 0 0 0;
    padding: 0;
}

.doctor-contact-form-wrapper input[type="submit"],
.doctor-contact-form-wrapper button[type="submit"],
.doctor-contact-form-wrapper .gform_button {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.doctor-contact-form-wrapper input[type="submit"]:hover,
.doctor-contact-form-wrapper button[type="submit"]:hover,
.doctor-contact-form-wrapper .gform_button:hover {
    background-color: #005a87;
}

.doctor-contact-form-wrapper input[type="submit"]:active,
.doctor-contact-form-wrapper button[type="submit"]:active,
.doctor-contact-form-wrapper .gform_button:active {
    transform: translateY(1px);
}

.doctor-contact-form-wrapper input[type="submit"]:focus,
.doctor-contact-form-wrapper button[type="submit"]:focus,
.doctor-contact-form-wrapper .gform_button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

/* Disabled/Loading State */
.doctor-contact-form-wrapper input[type="submit"]:disabled,
.doctor-contact-form-wrapper button[type="submit"]:disabled,
.doctor-contact-form-wrapper .gform_button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================================================
   Validation & Error States
   ========================================================================== */

.doctor-contact-form-wrapper .gfield_error input,
.doctor-contact-form-wrapper .gfield_error textarea,
.doctor-contact-form-wrapper .gfield_error select {
    border-color: #c0392b;
}

.doctor-contact-form-wrapper .gfield_error input:focus,
.doctor-contact-form-wrapper .gfield_error textarea:focus,
.doctor-contact-form-wrapper .gfield_error select:focus {
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

.doctor-contact-form-wrapper .validation_message,
.doctor-contact-form-wrapper .gfield_description.validation_message {
    display: block;
    margin: 5px 0 0 0;
    padding: 5px 8px;
    font-size: 0.8125em;
    color: #c0392b;
    background-color: #fdf2f2;
    border-radius: 2px;
}

.doctor-contact-form-wrapper .validation_error {
    margin: 0 0 15px 0;
    padding: 12px 15px;
    font-size: 0.875em;
    color: #c0392b;
    background-color: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
}

/* ==========================================================================
   Confirmation Message
   ========================================================================== */

.doctor-contact-form-wrapper .gform_confirmation_wrapper,
.doctor-contact-form-wrapper .gform_confirmation_message {
    padding: 20px;
    font-size: 1em;
    line-height: 1.6;
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 3px;
    text-align: center;
}

/* ==========================================================================
   AJAX Loading Spinner
   ========================================================================== */

.doctor-contact-form-wrapper .gform_ajax_spinner {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

/* ==========================================================================
   Hidden Fields
   ========================================================================== */

.doctor-contact-form-wrapper .gfield_visibility_hidden,
.doctor-contact-form-wrapper .gform_hidden {
    display: none !important;
    position: absolute;
    left: -9999px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 600px) {
    .doctor-contact-form-wrapper {
        padding: 15px;
    }

    .doctor-contact-form-wrapper .widget-title {
        font-size: 1.125em;
    }

    .doctor-contact-form-wrapper input[type="text"],
    .doctor-contact-form-wrapper input[type="email"],
    .doctor-contact-form-wrapper input[type="tel"],
    .doctor-contact-form-wrapper textarea {
        padding: 8px 10px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .doctor-contact-form-wrapper input[type="submit"],
    .doctor-contact-form-wrapper .gform_button {
        padding: 10px 20px;
    }
}

