/**
 * Petsure WPForms Widget Styles
 *
 * Resets WPForms default CSS and applies Petsure design system
 * using CSS variables (--petsure-*).
 * Section title styling is inherited from petsure-section-title-widget.
 * Submit button styling inherited from button.css via petsure-btn classes.
 */

.petsure-wpforms-wrapper {
    width: 100%;
}

.petsure-wpforms-form {
    margin-top: 40px;
    text-align: left;
}

/* ---------------------------------------------------- */
/* Reset all WPForms default styles
/* ---------------------------------------------------- */
.petsure-wpforms-form div.wpforms-container-full,
.petsure-wpforms-form div.wpforms-container-full *:not(.petsure-btn, .petsure-btn-icon, .petsure-btn-text, .petsure-pos-aware-bg) {
    background: none;
    border: 0 none;
    border-radius: 0;
    float: none;
    font-size: 100%;
    height: auto;
    letter-spacing: normal;
    outline: none;
    position: static;
    text-indent: 0;
    text-shadow: none;
    text-transform: none;
    width: auto;
    visibility: visible;
    overflow: visible;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    box-shadow: none;
}

.wpforms-container .wpforms-field-label.wpforms-label-hide,
.wpforms-container .wpforms-field-sublabel.wpforms-sublabel-hide,
.wp-core-ui div.wpforms-container .wpforms-field-label.wpforms-label-hide,
.wp-core-ui div.wpforms-container .wpforms-field-sublabel.wpforms-sublabel-hide {
    position: absolute !important;
    clip: rect(0 0 0 0) !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
}

/* Re-apply border-box to form elements that need it */
.petsure-wpforms-form div.wpforms-container-full input,
.petsure-wpforms-form div.wpforms-container-full textarea,
.petsure-wpforms-form div.wpforms-container-full select,
.petsure-wpforms-form div.wpforms-container-full button {
    box-sizing: border-box;
}

/* ---------------------------------------------------- */
/* WPForms container
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-container {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* ---------------------------------------------------- */
/* Fields
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-field {
    padding: 0;
    float: none;
    clear: both;
}

.petsure-wpforms-form .wpforms-field-container>.wpforms-field {
    margin-bottom: 24px !important;
}

.petsure-wpforms-form .wpforms-field-row {
    margin: 0;
    padding: 0;
}

.petsure-wpforms-form .wpforms-field-row::before,
.petsure-wpforms-form .wpforms-field-row::after {
    content: none !important;
    display: none !important;
}

.petsure-wpforms-form .wpforms-field-row-block {
    padding: 0 !important;
    margin: 0;
}

/* ---------------------------------------------------- */
/* Labels
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-field-label {
    color: var(--petsure-primary) !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    display: block;
}

.petsure-wpforms-form .wpforms-field-sublabel {
    color: var(--petsure-text);
    font-size: 13px;
    display: block;
    margin-top: 4px;
    margin-bottom: 2px;
}

.petsure-wpforms-form .wpforms-required-label {
    color: var(--petsure-accent);
}

/* ---------------------------------------------------- */
/* Inputs, textarea, select
/* ---------------------------------------------------- */
.petsure-wpforms-form input[type="text"],
.petsure-wpforms-form input[type="email"],
.petsure-wpforms-form input[type="tel"],
.petsure-wpforms-form input[type="url"],
.petsure-wpforms-form input[type="password"],
.petsure-wpforms-form input[type="number"],
.petsure-wpforms-form input[type="date"],
.petsure-wpforms-form input[type="time"],
.petsure-wpforms-form textarea,
.petsure-wpforms-form select {
    border: 1px solid rgba(var(--petsure-primary-rgb), 0.2) !important;
    border-radius: var(--petsure-border-radius) !important;
    background: var(--petsure-white) !important;
    color: var(--petsure-text) !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    transition: border-color 0.3s ease;
    display: block;
}

.petsure-wpforms-form input:hover,
.petsure-wpforms-form textarea:hover,
.petsure-wpforms-form select:hover {
    border-color: rgba(var(--petsure-primary-rgb), 0.4) !important;
}

.petsure-wpforms-form input:focus,
.petsure-wpforms-form textarea:focus,
.petsure-wpforms-form select:focus {
    border-color: var(--petsure-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(var(--petsure-accent-rgb), 0.15) !important;
}

.petsure-wpforms-form input::placeholder,
.petsure-wpforms-form textarea::placeholder {
    color: var(--petsure-text);
    opacity: 0.6;
}

/* ---------------------------------------------------- */
/* intl-tel-input phone field (flag dropdown)
/* ---------------------------------------------------- */
.petsure-wpforms-form input.iti__tel-input {
    padding: 14px 16px !important;
    padding-left: 64px !important;
}

.petsure-wpforms-form .iti__selected-country {
    box-shadow: none !important;
    border: none !important;
    min-width: 55px;
}

/* ---------------------------------------------------- */
/* Layout rows / columns
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-field-layout-rows {
    padding: 0;
    margin: 0;
}

.petsure-wpforms-form .wpforms-layout-row {
    display: flex;
    gap: 20px;
    margin: 0 !important;
    padding: 0;
}

.petsure-wpforms-form .wpforms-layout-column {
    padding: 0 !important;
    margin: 0 !important;
    word-break: break-word;
}

.petsure-wpforms-form .wpforms-field-row {
    display: flex;
    gap: 20px;
}

.petsure-wpforms-form .wpforms-field-row-block {
    flex: 1;
}

/* ---------------------------------------------------- */
/* Checkbox / Radio
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-field-checkbox ul,
.petsure-wpforms-form .wpforms-field-radio ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.petsure-wpforms-form .wpforms-field-checkbox li,
.petsure-wpforms-form .wpforms-field-radio li {
    margin: 0 0 10px;
    padding: 0;
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
}

/* Base checkbox/radio input */
.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"],
.petsure-wpforms-form .wpforms-field-radio input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    margin: 0 !important;
    margin-top: 3px !important;
    flex-shrink: 0;
    border: 2px solid rgba(var(--petsure-primary-rgb), 0.25) !important;
    background: var(--petsure-white) !important;
    cursor: pointer;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-shadow: none !important;
    outline: none;
}

.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"] {
    border-radius: 4px !important;
}

.petsure-wpforms-form .wpforms-field-radio input[type="radio"] {
    border-radius: 50% !important;
}

/* Hover */
.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"]:hover,
.petsure-wpforms-form .wpforms-field-radio input[type="radio"]:hover {
    border-color: var(--petsure-accent) !important;
}

/* Checked state - Checkbox */
.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"]:checked {
    border-color: var(--petsure-accent) !important;
    background: var(--petsure-accent) !important;
}

/* Checkmark (checkbox ::after) */
.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"]:checked::after {
    content: '' !important;
    display: block !important;
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--petsure-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
}

/* Hide WPForms checkbox ::before */
.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"]:checked::before {
    content: none !important;
    display: none !important;
}

/* Checked state - Radio */
.petsure-wpforms-form .wpforms-field-radio input[type="radio"]:checked {
    border-color: var(--petsure-accent) !important;
}

/* Radio dot (radio ::before) */
.petsure-wpforms-form .wpforms-field-radio input[type="radio"]:checked::before {
    content: '' !important;
    display: block !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--petsure-accent) !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

/* Focus state for checkbox/radio: override WPForms ::before */
.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"]:focus::before,
.petsure-wpforms-form .wpforms-field-radio input[type="radio"]:focus::before {
    border: none !important;
    box-shadow: none !important;
    content: none !important;
    display: none !important;
}

/* Focus ring on the input itself */
.petsure-wpforms-form .wpforms-field-checkbox input[type="checkbox"]:focus,
.petsure-wpforms-form .wpforms-field-radio input[type="radio"]:focus {
    border-color: var(--petsure-accent) !important;
    box-shadow: 0 0 0 3px rgba(var(--petsure-accent-rgb), 0.15) !important;
    outline: none !important;
}

.petsure-wpforms-form .wpforms-field-label-inline {
    color: var(--petsure-text);
    font-size: 15px;
    font-weight: 400;
    display: inline;
}

/* ---------------------------------------------------- */
/* Select / Choices.js
/* ---------------------------------------------------- */
.petsure-wpforms-form .choices {
    padding: 0;
    margin: 0;
}

.petsure-wpforms-form .choices__inner,
.petsure-wpforms-form .wpforms-container .choices[data-type*="select-one"] .choices__inner {
    border: 1px solid rgba(var(--petsure-primary-rgb), 0.2) !important;
    border-radius: var(--petsure-border-radius) !important;
    background: var(--petsure-white) !important;
    padding: 0 !important;
    min-height: auto !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    transition: border-color 0.3s ease;
    position: relative;
}

.petsure-wpforms-form .choices[data-type*="select-one"] .choices__inner::after {
    content: '\f078';
    font-family: 'Font Awesome 7 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--petsure-text);
    opacity: 0.6;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.petsure-wpforms-form .choices.is-open[data-type*="select-one"] .choices__inner::after {
    transform: translateY(-50%) rotate(180deg);
}

.petsure-wpforms-form .choices:hover .choices__inner {
    border-color: rgba(var(--petsure-primary-rgb), 0.4) !important;
}

html .petsure-wpforms-form .wpforms-container .wpforms-field.wpforms-field-select-style-modern .choices.is-open .choices__inner,
html .petsure-wpforms-form .wpforms-container .wpforms-field.wpforms-field-select-style-modern .choices.is-focused .choices__inner,
html .petsure-wpforms-form .wpforms-container .wpforms-field.wpforms-field-select-style-modern .choices.is-open .choices__list--dropdown {
    border-color: var(--petsure-accent) !important;
    box-shadow: 0 0 0 2px rgba(var(--petsure-accent-rgb), 0.15) !important;
}

.petsure-wpforms-form .choices__list--single {
    padding: 0 !important;
}

.petsure-wpforms-form .choices__list--single .choices__item {
    line-height: 1.5;
    display: flex;
    align-items: center;
    padding: 14px 16px !important;
}

.petsure-wpforms-form .choices__placeholder {
    color: var(--petsure-text) !important;
    opacity: 0.6 !important;
}

.petsure-wpforms-form .choices__list--dropdown {
    border: 1px solid rgba(var(--petsure-primary-rgb), 0.2) !important;
    border-radius: var(--petsure-border-radius) !important;
    background: var(--petsure-white) !important;
    box-shadow: 0 4px 20px rgba(var(--petsure-primary-rgb), 0.1);
}

.petsure-wpforms-form .choices__item--choice {
    padding: 10px 16px !important;
}

.petsure-wpforms-form .choices__item--selectable {
    color: var(--petsure-text) !important;
    font-size: 15px !important;
    padding: 10px 16px !important;
    transition: background 0.2s ease;
}

.petsure-wpforms-form .choices__item--selectable.is-highlighted {
    background: rgba(var(--petsure-accent-rgb), 0.2) !important;
    color: var(--petsure-primary) !important;
}

.petsure-wpforms-form .choices__item.is-selected {
    font-weight: 600 !important;
    color: var(--petsure-primary) !important;
}

.petsure-wpforms-form .choices__item--choice.choices__placeholder {
    opacity: 0.5 !important;
    font-weight: 400 !important;
    color: var(--petsure-text) !important;
}

.petsure-wpforms-form .choices__button {
    display: none;
}

.petsure-wpforms-form .choices__list--dropdown .choices__list {
    max-height: 220px;
}

/* ---------------------------------------------------- */
/* Submit button
/* Uses petsure-btn classes (added via JS) + button.css styles.
/* High specificity to beat WPForms' default selectors like
/* .wp-core-ui div.wpforms-container-full button[type=submit]
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-submit-container {
    padding: 0;
    margin: 32px 0 0;
    text-align: left;
    clear: both;
}

.petsure-wpforms-form div.wpforms-container-full .wpforms-submit.petsure-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--petsure-border-radius);
    position: relative;
    overflow: hidden;
    line-height: 1.2;
    font-family: 'Bricolage Grotesque', sans-serif;
    cursor: pointer;
    width: auto;
    height: auto;
    text-decoration: none;
    text-transform: capitalize;
    border: none;
    box-shadow: none;
    transition: all 0.4s ease-in-out;
    letter-spacing: normal;
    margin: 0;
    min-height: 55px;
    background: var(--petsure-accent);
    color: var(--petsure-white);
}

.petsure-wpforms-form div.wpforms-container-full .wpforms-submit.petsure-btn:hover {
    color: var(--petsure-white);
}

/* Position-aware hover background */
.petsure-wpforms-form div.wpforms-container-full .wpforms-submit.petsure-btn .petsure-pos-aware-bg {
    position: absolute !important;
    display: block;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    pointer-events: none !important;
    z-index: 0 !important;
    transform: translate(-50%, -50%) !important;
    transition: all ease-in-out 0.4s !important;
    aspect-ratio: 1;
    background: var(--petsure-secondary);
}

.petsure-wpforms-form div.wpforms-container-full .wpforms-submit.petsure-btn:hover .petsure-pos-aware-bg {
    width: 900px !important;
    height: 900px !important;
}

.petsure-wpforms-form div.wpforms-container-full .wpforms-submit.petsure-btn .petsure-btn-text {
    position: relative;
    z-index: 1;
}

.petsure-wpforms-form div.wpforms-container-full .wpforms-submit.petsure-btn .petsure-btn-icon {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 35px !important;
    height: 35px !important;
    background: var(--petsure-primary) !important;
    color: var(--petsure-accent) !important;
    border-radius: var(--petsure-border-radius) !important;
    font-size: 17px !important;
    z-index: 1 !important;
    transition: all 0.4s ease-in-out !important;
}

/* Scheme-specific icon colors */
.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-primary .wpforms-submit.petsure-btn .petsure-btn-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    color: var(--petsure-white) !important;
}

.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-primary .wpforms-submit.petsure-btn:hover .petsure-btn-icon {
    background: rgba(255, 255, 255, 0.35) !important;
    color: var(--petsure-white) !important;
}

.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-outline .wpforms-submit.petsure-btn .petsure-btn-icon {
    background: var(--petsure-primary) !important;
    color: var(--petsure-white) !important;
}

.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-outline .wpforms-submit.petsure-btn:hover .petsure-btn-icon {
    background: var(--petsure-white) !important;
    color: var(--petsure-primary) !important;
}

.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-translucid .wpforms-submit.petsure-btn .petsure-btn-icon {
    background: rgba(255, 255, 255, 0.25) !important;
    color: var(--petsure-white) !important;
}

.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-translucid .wpforms-submit.petsure-btn:hover .petsure-btn-icon {
    background: var(--petsure-primary) !important;
    color: var(--petsure-white) !important;
}

/* Scheme-specific bg trail colors */
.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-primary .wpforms-submit.petsure-btn .petsure-pos-aware-bg {
    background: var(--petsure-secondary);
}

.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-outline .wpforms-submit.petsure-btn .petsure-pos-aware-bg {
    background: var(--petsure-primary);
}

.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-translucid .wpforms-submit.petsure-btn .petsure-pos-aware-bg {
    background: var(--petsure-white);
}

/* Default scheme: accent */
.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-accent .wpforms-submit.petsure-btn {
    background: var(--petsure-accent);
    color: var(--petsure-white);
}

/* Primary scheme */
.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-primary .wpforms-submit.petsure-btn {
    background: var(--petsure-primary);
    color: var(--petsure-white);
    overflow: hidden;
}

/* Outline scheme */
.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-outline .wpforms-submit.petsure-btn {
    background: transparent;
    color: var(--petsure-primary);
    box-shadow: inset 0 0 0 2px var(--petsure-primary);
}

/* Translucid scheme */
.petsure-wpforms-form div.wpforms-container-full .petsure-btn-scheme-translucid .wpforms-submit.petsure-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--petsure-white);
    border: none;
}

/* ---------------------------------------------------- */
/* Errors
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-error,
.petsure-wpforms-form label.wpforms-error,
.petsure-wpforms-form em.wpforms-error {
    color: var(--petsure-error) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    margin-top: 4px !important;
    padding: 0 !important;
    position: relative !important;
    display: block;
}

.petsure-wpforms-form input.wpforms-error,
.petsure-wpforms-form textarea.wpforms-error {
    border-color: var(--petsure-error);
}

/* ---------------------------------------------------- */
/* Honeypot
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-field-hp {
    display: none;
}

/* ---------------------------------------------------- */
/* Noscript
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-error-noscript {
    color: var(--petsure-error);
    padding: 10px 0;
}

/* ---------------------------------------------------- */
/* Confirmation
/* ---------------------------------------------------- */
.petsure-wpforms-form .wpforms-confirmation-container-full {
    background: var(--petsure-background);
    padding: 30px;
    border-radius: var(--petsure-border-radius-lg);
    color: var(--petsure-primary);
}

/* ---------------------------------------------------- */
/* Empty state
/* ---------------------------------------------------- */
.petsure-wpforms-empty {
    padding: 40px;
    background: var(--petsure-background);
    border-radius: var(--petsure-border-radius-lg);
    text-align: center;
}

.petsure-wpforms-empty p {
    margin: 0;
    color: var(--petsure-text);
}