/* Premium Responsive Frontend Forms CSS using Variables */

.eqm-custom-form-wrapper {
    max-width: var(--eqm-form-width, 100%);
    background: var(--eqm-form-bg, #ffffff);
    color: var(--eqm-form-text, #333333);
    font-size: var(--eqm-form-font-size, 14px);
    border-radius: var(--eqm-form-radius, 4px);
    box-sizing: border-box;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--eqm-form-border, #e2e4e7);
    margin: 20px auto;
    font-family: inherit;
}

.eqm-custom-form-wrapper * {
    box-sizing: border-box;
}

/* Layout Grid Modes */
.eqm-form-fields-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px;
}

.eqm-form-field-row {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
}

/* Dynamic Column Grids */
.eqm-col-12 {
    flex: 0 0 100% !important;
}

.eqm-col-2 {
    flex: 0 0 calc(50% - 10px) !important;
}

.eqm-col-3 {
    flex: 0 0 calc(33.333% - 13.33px) !important;
}

.eqm-col-4 {
    flex: 0 0 calc(25% - 15px) !important;
}

/* Label Alignments */
.eqm-field-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: inherit;
    font-size: 0.95em;
}

.eqm-required-star {
    color: #ff001e;
    margin-left: 3px;
}

.eqm-labels-left .eqm-form-field-row {
    flex-direction: row;
    align-items: center;
}

.eqm-labels-left .eqm-field-label {
    flex: 0 0 180px;
    margin-bottom: 0;
    padding-right: 15px;
}

.eqm-labels-left .eqm-field-input-wrap {
    flex: 1;
}

/* Input Fields Styles */
.eqm-field-input-wrap input[type="text"],
.eqm-field-input-wrap input[type="email"],
.eqm-field-input-wrap input[type="tel"],
.eqm-field-input-wrap input[type="number"],
.eqm-field-input-wrap input[type="date"],
.eqm-field-input-wrap select,
.eqm-field-input-wrap textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--eqm-form-border, #cccccc);
    border-radius: var(--eqm-form-radius, 4px);
    font-size: inherit;
    font-family: inherit;
    background: #fff;
    color: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Custom dropdown arrow for select elements */
.eqm-field-input-wrap select,
.eqm-custom-form-wrapper select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #ffffff !important;
    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='%23333333' 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") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
    padding-right: 40px !important;
    cursor: pointer;
    line-height: 1.4;
}

.eqm-field-input-wrap select:disabled,
.eqm-custom-form-wrapper select:disabled {
    background-color: #f3f4f6 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.eqm-field-input-wrap select::-ms-expand,
.eqm-custom-form-wrapper select::-ms-expand {
    display: none;
}

/* RTL Support for Selects */
[dir="rtl"] .eqm-field-input-wrap select,
.rtl .eqm-field-input-wrap select,
[dir="rtl"] .eqm-custom-form-wrapper select,
.rtl .eqm-custom-form-wrapper select {
    background-position: left 14px center !important;
    padding-left: 40px !important;
    padding-right: 12px !important;
}

.eqm-field-input-wrap input:focus,
.eqm-field-input-wrap select:focus,
.eqm-field-input-wrap textarea:focus {
    border-color: var(--eqm-form-primary, #ff001e);
    box-shadow: 0 0 0 3px rgba(255, 0, 30, 0.1);
}

.eqm-field-input-wrap textarea {
    resize: vertical;
    min-height: 120px;
}

/* Product preview link below dropdown */
.eqm-product-link-wrap {
    margin-top: 6px;
    font-size: 13px;
}

.eqm-product-preview-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #3A3E5D;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.eqm-product-preview-link:hover {
    color: var(--eqm-form-primary, #ff001e);
    text-decoration: underline;
    transform: translateX(2px);
}

/* Heading & Custom HTML Blocks */
.eqm-field-heading {
    margin: 10px 0 5px 0;
    color: inherit;
    font-size: 1.3em;
    font-weight: 700;
}

.eqm-field-html-block {
    margin: 5px 0;
    color: inherit;
}

/* Checkboxes and Radios styling */
.eqm-radio-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: normal;
}

.eqm-radio-check-label input {
    margin: 0;
    width: auto;
}

/* Button & Alignment Properties */
.eqm-form-submit-row {
    margin-top: 25px;
    display: flex;
}

.eqm-align-left {
    justify-content: flex-start;
}

.eqm-align-center {
    justify-content: center;
}

.eqm-align-right {
    justify-content: flex-end;
}

.eqm-align-full .eqm-btn-submit {
    width: 100%;
}

.eqm-btn-submit {
    padding: 12px 25px;
    font-size: 1.05em;
    font-weight: 700;
    border-radius: var(--eqm-form-radius, 4px);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

/* Button styles */
.eqm-btn-solid {
    background: var(--eqm-form-primary, #ff001e);
    color: #ffffff;
    border: 2px solid var(--eqm-form-primary, #ff001e);
}

.eqm-btn-solid:hover {
    background: #e1001a;
    border-color: #e1001a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.eqm-btn-outline {
    background: transparent;
    color: var(--eqm-form-primary, #ff001e);
    border: 2px solid var(--eqm-form-primary, #ff001e);
}

.eqm-btn-outline:hover {
    background: var(--eqm-form-primary, #ff001e);
    color: #ffffff;
    transform: translateY(-1px);
}

.eqm-btn-pill {
    background: var(--eqm-form-primary, #ff001e);
    color: #ffffff;
    border: 2px solid var(--eqm-form-primary, #ff001e);
    border-radius: 50px;
}

.eqm-btn-pill:hover {
    background: #e1001a;
    border-color: #e1001a;
    transform: translateY(-1px);
}

/* Spinner Loader animation */
.eqm-btn-submit .spinner {
    display: none;
    float: none;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: eqmspin 0.8s linear infinite;
    background: none;
}

.eqm-btn-outline .spinner {
    border-color: rgba(255, 0, 30, 0.2);
    border-top-color: var(--eqm-form-primary, #ff001e);
}

.eqm-btn-submit.loading .spinner {
    display: inline-block;
}

@keyframes eqmspin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Success/Error Alerts Banners */
.eqm-form-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: var(--eqm-form-radius, 4px);
    font-weight: 600;
    display: none;
}

.eqm-form-message.success {
    background: #eceeff;
    color: #3A3E5D;
    border: 1px solid #8691e1;
    display: block;
}

.eqm-form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

/* Mobile Responsiveness */
@media(max-width: 600px) {
    .eqm-layout-2col .eqm-col-half {
        flex: 0 0 100%;
    }

    .eqm-labels-left .eqm-form-field-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .eqm-labels-left .eqm-field-label {
        flex: 0 0 auto;
        padding-right: 0;
        margin-bottom: 6px;
    }
}

/* CAPTCHA & Security Elements */
.eqm-captcha-row {
    margin: 18px 0;
}

.eqm-custom-math-row .eqm-math-captcha-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.eqm-custom-math-row .eqm-math-question-text {
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: var(--eqm-form-radius, 4px);
    font-weight: 700;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.eqm-custom-math-row .eqm-math-answer-input {
    max-width: 120px !important;
    height: 38px !important;
    padding: 6px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--eqm-form-radius, 4px) !important;
    font-weight: 600 !important;
    font-size: 15px !important;
}

.eqm-custom-math-row .eqm-captcha-refresh {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--eqm-form-radius, 4px);
    padding: 7px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    height: 38px;
    transition: all 0.2s ease;
}

.eqm-custom-math-row .eqm-captcha-refresh:hover {
    color: var(--eqm-form-primary, #ff001e);
    border-color: var(--eqm-form-primary, #ff001e);
}

.eqm-rotating {
    animation: eqmspin 0.6s linear infinite;
}