/**
 * reCAPTCHA Integration Styles
 *
 * Provides consistent styling for Google reCAPTCHA v2 widgets across the site
 * ensuring proper alignment, spacing, and responsive behavior.
 */

/* ============================================================================
   General reCAPTCHA Wrapper Styles
   ============================================================================ */

.recaptcha-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure reCAPTCHA is centered */
.recaptcha-wrapper .g-recaptcha {
    display: inline-block;
}

/* ============================================================================
   Contact Form Specific Styles (index.php)
   ============================================================================ */

#contact .recaptcha-wrapper {
    padding: 15px 0;
    text-align: center;
}

/* Align with other form elements in contact form */
#contact .recaptcha-wrapper .g-recaptcha {
    margin: 0 auto;
}

/* ============================================================================
   Quality Stars Form Specific Styles (quality-stars.php)
   ============================================================================ */

.quality-form .recaptcha-wrapper {
    text-align: center;
    padding: 10px 0;
}

.quality-form .recaptcha-wrapper .g-recaptcha {
    margin: 0 auto;
}

/* ============================================================================
   Responsive Styles
   ============================================================================ */

/* Mobile devices (phones, portrait tablets) */
@media (max-width: 767px) {
    .recaptcha-wrapper {
        margin-top: 15px;
        margin-bottom: 15px;
    }

    /* For compact size on mobile if configured */
    .recaptcha-wrapper .g-recaptcha {
        transform: scale(0.9);
        transform-origin: center center;
    }
}

/* Very small devices */
@media (max-width: 480px) {
    /* Scale down reCAPTCHA slightly on very small screens */
    .recaptcha-wrapper .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

/* ============================================================================
   Light Theme Overrides (if needed)
   ============================================================================ */

.recaptcha-light .g-recaptcha {
    /* Add any light theme specific styles here */
}

/* ============================================================================
   Dark Theme Overrides (if needed)
   ============================================================================ */

.recaptcha-dark .g-recaptcha {
    /* Add any dark theme specific styles here */
}

/* ============================================================================
   Loading State
   ============================================================================ */

/* Optional: Add a loading indicator while reCAPTCHA loads */
.recaptcha-wrapper::before {
    content: '';
    display: none; /* Hidden by default, can be shown via JS if needed */
    width: 304px; /* Standard reCAPTCHA width */
    height: 78px; /* Standard reCAPTCHA height */
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 3px;
}

/* ============================================================================
   Error State Styling
   ============================================================================ */

/* Highlight wrapper when reCAPTCHA validation fails */
.recaptcha-wrapper.has-error {
    border: 2px solid #d9534f;
    border-radius: 4px;
    padding: 10px;
    background-color: #f2dede;
}

.recaptcha-wrapper.has-error .g-recaptcha {
    /* Additional error state styles if needed */
}

/* ============================================================================
   Accessibility Improvements
   ============================================================================ */

/* Focus visible for keyboard navigation */
.g-recaptcha:focus-visible {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .recaptcha-wrapper,
    .g-recaptcha {
        display: none !important;
    }
}
