/* Force the quote card edge-to-edge on mobile regardless of which template/container
   wraps the [conveyancing_quote_2_0] / [ConveyancingQuoteForm] shortcode - the card is
   embedded across many templates with different container padding (services-new.php,
   quote-template-2-0.php, single-slm_service_page.php, conveyancing-org.php, etc.), so it
   can't rely on the parent removing its own padding. Same breakout technique as the
   services-grid/intro-with-key-facts "full-width" layout option. Reverts to normal
   contained flow at md (768px) and up, where the existing p-6/md:rounded-lg look is fine. */
@media (max-width: 767px) {
    .conveyancing-quote-card {
        width: 100vw;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0;
    }
}

/* Custom styles for active state */
#conveyancing-form .option-label input[type="radio"]:checked + span,
#instant-quote-form .option-label input[type="radio"]:checked + span {
    color: white;
}

/* Style for the radio button when label is hovered or active */
#conveyancing-form .option-label:hover .radio-input,
#conveyancing-form .option-label:has(input[type="radio"]:checked) .radio-input,
#instant-quote-form .option-label:hover .radio-input,
#instant-quote-form .option-label:has(input[type="radio"]:checked) .radio-input {
    border-color: white;
    background-color: transparent;
}

/* Style for the radio button's checked state when label is hovered or active */
#conveyancing-form .option-label:hover .radio-input:checked,
#conveyancing-form .option-label:has(input[type="radio"]:checked) .radio-input:checked,
#instant-quote-form .option-label:hover .radio-input:checked,
#instant-quote-form .option-label:has(input[type="radio"]:checked) .radio-input:checked {
    border-color: white;
    background-color: transparent;
}

/* Style for the radio button's circle when checked and label is hovered or active */
#conveyancing-form .option-label:hover .radio-input:checked::before,
#conveyancing-form .option-label:has(input[type="radio"]:checked) .radio-input:checked::before,
#instant-quote-form .option-label:hover .radio-input:checked::before,
#instant-quote-form .option-label:has(input[type="radio"]:checked) .radio-input:checked::before {
    background-color: white;
}

/* Override the default appearance */
#conveyancing-form .radio-input,
#instant-quote-form .radio-input {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #ccc;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    transition: all 0.2s ease;
}

#conveyancing-form .radio-input:checked,
#instant-quote-form .radio-input:checked {
    border-color: var(--color-primary, #282837);
}

#conveyancing-form .radio-input:checked::before,
#instant-quote-form .radio-input:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--color-primary, #282837);
}

#conveyancing-form .option-label:has(input[type="radio"]:checked),
#instant-quote-form .option-label:has(input[type="radio"]:checked) {
    background-color: var(--color-primary, #282837);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#conveyancing-form .form-group,
#instant-quote-form .form-group {
    margin-top: 0 !important;
}

#conveyancing-form .full-width-section,
#instant-quote-form .full-width-section {
    max-width: calc(100vw) !important;
    margin-left: -24px !important;
    margin-right: -24px !important;
    position: relative;
}

#conveyancing-form .floating-image,
#instant-quote-form .floating-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    transform: translate(0, 0);
    width: 430px;
}

/* Improved select styling with better arrow positioning */
#conveyancing-form select,
#instant-quote-form select {
    padding-right: 2.5rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23282837'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1rem !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: #fff !important;
}

/* Remove default arrow in IE10+ */
#conveyancing-form select::-ms-expand,
#instant-quote-form select::-ms-expand {
    display: none !important;
}

/* Error message styling - updated for better visibility */
#conveyancing-form .error-message,
#instant-quote-form .error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
}

#conveyancing-form .field-error,
#instant-quote-form .field-error {
    border: 2px solid #e53e3e !important;
    background-color: #fff5f5 !important;
}

#conveyancing-form .radio-group-error,
#instant-quote-form .radio-group-error {
    border: 2px solid #e53e3e;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background-color: #fff5f5;
}

/* Accessibility focus styles */
#conveyancing-form input:focus,
#conveyancing-form select:focus,
#conveyancing-form textarea:focus,
#conveyancing-form button:focus,
#instant-quote-form input:focus,
#instant-quote-form select:focus,
#instant-quote-form textarea:focus,
#instant-quote-form button:focus {
    outline: 2px solid #282837;
    outline-offset: 2px;
}

/* High contrast focus for keyboard navigation */
#conveyancing-form input:focus-visible,
#conveyancing-form select:focus-visible,
#conveyancing-form textarea:focus-visible,
#conveyancing-form button:focus-visible,
#instant-quote-form input:focus-visible,
#instant-quote-form select:focus-visible,
#instant-quote-form textarea:focus-visible,
#instant-quote-form button:focus-visible {
    outline: 3px solid #282837;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px rgba(40, 40, 55, 0.3);
}

/* Skip to content link for keyboard users */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-to-content:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 10px;
    background: #282837;
    color: white;
    z-index: 9999;
}

#conveyancing-form #loading-overlay,
#instant-quote-form #loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

#conveyancing-form .animate-spin,
#instant-quote-form .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}