/* VeriGrid Quote Builder v2.1.0 — Dynamic 1–4 Step Wizard + Modal + Turnstile */

/* Trigger Button & Link */
.vg-qf-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1E40AF;
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 600;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
    transition: background 0.15s ease, transform 0.1s ease;
    line-height: 1.25;
}

.vg-qf-trigger-btn:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
}

.vg-qf-trigger-link {
    color: #1E40AF;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.vg-qf-trigger-link:hover {
    color: #1e3a8a;
}

/* Modal Overlay */
.vg-qf-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.vg-qf-modal.is-open {
    display: flex;
    animation: vgQfFadeIn 0.18s ease;
}

.vg-qf-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
}

.vg-qf-modal-dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 12px;
}

.vg-qf-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 5;
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.vg-qf-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

body.vg-qf-modal-open {
    overflow: hidden;
}

/* Form Wrapper */
.vg-qf-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    max-width: 680px;
    margin: 0 auto 24px;
    font-family: inherit;
    color: #0f172a;
    box-sizing: border-box;
}

.vg-qf-wrapper.vg-qf-in-modal {
    margin: 0;
    max-width: 100%;
    border: none;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding-right: 32px;
}

.vg-qf-wrapper *,
.vg-qf-wrapper *::before,
.vg-qf-wrapper *::after {
    box-sizing: border-box;
}

.vg-qf-wrapper br,
.vg-qf-wrapper p:empty {
    display: none !important;
}

.vg-qf-wrapper.vg-qf-compact {
    padding: 18px 20px;
    max-width: 100%;
}

.vg-qf-header {
    margin-bottom: 16px;
    padding-right: 32px;
}

.vg-qf-title {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.vg-qf-compact .vg-qf-title {
    font-size: 1.15rem;
}

.vg-qf-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

/* Progress Bar */
.vg-qf-progress-wrap {
    margin-bottom: 18px;
}

.vg-qf-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.vg-qf-progress-bar {
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.vg-qf-progress-fill {
    height: 100%;
    background: #1E40AF;
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* Steps */
.vg-qf-step {
    display: none;
}

.vg-qf-step.vg-qf-step-active {
    display: block;
    animation: vgQfFadeIn 0.2s ease;
}

@keyframes vgQfFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Honeypot */
.vg-qf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Dynamic 2-Column Responsive Field Grid */
.vg-qf-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 12px;
}

.vg-qf-col-full {
    grid-column: 1 / -1;
}

.vg-qf-col-half {
    grid-column: span 1;
}

.vg-qf-compact .vg-qf-col-half {
    grid-column: 1 / -1;
}

/* Fields */
.vg-qf-field-group {
    margin-bottom: 16px;
}

.vg-qf-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.vg-qf-req {
    color: #b91c1c;
}

.vg-qf-opt {
    font-weight: 400;
    font-size: 0.82rem;
    color: #64748b;
}

.vg-qf-input,
.vg-qf-select,
.vg-qf-textarea {
    width: 100%;
    padding: 11px 13px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vg-qf-textarea {
    min-height: 82px;
    resize: vertical;
    line-height: 1.45;
}

.vg-qf-input:focus,
.vg-qf-select:focus,
.vg-qf-textarea:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

/* Radio Tiles */
.vg-qf-tile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.vg-qf-tile-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.vg-qf-tile {
    display: block;
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.vg-qf-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vg-qf-tile-box {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.94rem;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.15s ease;
}

.vg-qf-tile-box::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    margin-right: 11px;
    flex-shrink: 0;
    background: #ffffff;
    transition: all 0.15s ease;
}

.vg-qf-tile:hover .vg-qf-tile-box {
    border-color: #1E40AF;
    background: #eff6ff;
}

.vg-qf-tile input[type="radio"]:checked + .vg-qf-tile-box {
    border-color: #1E40AF;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.12);
}

.vg-qf-tile input[type="radio"]:checked + .vg-qf-tile-box::before {
    border-color: #1E40AF;
    border-width: 5px;
}

/* Radio Pills */
.vg-qf-pill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 8px;
}

.vg-qf-pill {
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.vg-qf-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vg-qf-pill-box {
    display: block;
    text-align: center;
    padding: 11px 8px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.94rem;
    color: #1e293b;
    transition: all 0.15s ease;
}

.vg-qf-pill:hover .vg-qf-pill-box {
    border-color: #1E40AF;
    background: #eff6ff;
}

.vg-qf-pill input[type="radio"]:checked + .vg-qf-pill-box {
    border-color: #1E40AF;
    background: #1E40AF;
    color: #ffffff;
}

/* Checkbox / TCPA */
.vg-qf-tcpa-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 11px 13px;
}

.vg-qf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #475569;
    cursor: pointer;
    margin: 0;
}

.vg-qf-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #1E40AF;
}

.vg-qf-turnstile-wrap {
    margin-top: 8px;
}

/* Errors */
.vg-qf-error {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.86rem;
    padding: 9px 12px;
    border-radius: 7px;
    margin-bottom: 14px;
}

.vg-qf-error.is-visible {
    display: block;
}

/* Buttons */
.vg-qf-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.vg-qf-actions-end {
    justify-content: flex-end;
}

.vg-qf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.vg-qf-btn-primary,
.vg-qf-btn-submit {
    background: #1E40AF;
    color: #ffffff;
}

.vg-qf-btn-primary:hover,
.vg-qf-btn-submit:hover {
    background: #1e3a8a;
}

.vg-qf-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.vg-qf-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.vg-qf-btn-secondary:hover {
    background: #e2e8f0;
}

.vg-qf-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: vgQfSpin 0.65s linear infinite;
}

.vg-qf-btn-submit.is-loading .vg-qf-spinner {
    display: inline-block;
}

@keyframes vgQfSpin {
    to { transform: rotate(360deg); }
}

/* Success State */
.vg-qf-success {
    text-align: center;
    padding: 20px 10px;
}

.vg-qf-success-icon {
    width: 52px;
    height: 52px;
    line-height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 26px;
    font-weight: 700;
}

.vg-qf-success-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    color: #0f172a;
}

.vg-qf-success-text {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .vg-qf-wrapper {
        padding: 18px 16px;
    }
    .vg-qf-fields-grid,
    .vg-qf-tile-grid-2col {
        grid-template-columns: 1fr;
    }
    .vg-qf-col-half {
        grid-column: 1 / -1;
    }
}
