/* ============================================================
   Vendor Application Form — Hopkinton State Fair
   Floats as white cards on the theme's #007dc5 blue background.
   Uses !important where Avada theme rules must be overridden.
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
.vm-application-form-wrap {
    --vm-blue:        #007dc5;
    --vm-blue-dark:   #005f96;
    --vm-green:       #a0ce4e;
    --vm-green-dark:  #6dab3c;
    --vm-amber:       #f59e0b;
    --vm-amber-light: #fffbeb;
    --vm-amber-border:#fcd34d;
    --vm-red:         #dc2626;
    --vm-red-light:   #fef2f2;
    --vm-red-border:  #fca5a5;
    --vm-navy:        #1e2d3d;
    --vm-text:        #1f2937;
    --vm-text-mid:    #4b5563;
    --vm-text-light:  #6b7280;
    --vm-border:      #d1d5db;
    --vm-bg-soft:     #f8fafc;
    --vm-white:       #ffffff;
    --vm-radius:      8px;
    --vm-radius-sm:   5px;
    --vm-shadow:      0 2px 8px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
    --vm-shadow-lg:   0 4px 16px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.10);

    margin: 30px 0 0;
    font-family: 'Open Sans', sans-serif;
}

/* ── Error alert ────────────────────────────────────────────── */
.vm-alert {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: var(--vm-radius-sm);
    margin-bottom: 24px;
    background: var(--vm-white);
}
.vm-alert--error {
    background: var(--vm-red-light);
    border: 1px solid var(--vm-red-border);
    border-left: 4px solid var(--vm-red);
}

.vm-alert__icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--vm-text) !important;
}
.vm-alert--error .vm-alert__icon { color: var(--vm-red) !important; }
.vm-alert--insurance .vm-alert__icon { color: var(--vm-amber) !important; }
.vm-alert__body { flex: 1; }
.vm-alert__body strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--vm-text) !important;
    margin-bottom: 4px;
}
.vm-alert__body p,
.vm-alert__body ul,
.vm-alert__body li {
    font-size: 14px;
    color: var(--vm-text-mid) !important;
    margin: 0;
    line-height: 1.6;
}
.vm-alert__body ul { padding-left: 18px; margin-top: 6px; }
.vm-alert__body li { margin-bottom: 3px; }

/* ── Section cards ──────────────────────────────────────────── */
.vm-section {
    background: var(--vm-white);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--vm-radius);
    box-shadow: var(--vm-shadow);
    margin-bottom: 18px;
    overflow: hidden;
}
.vm-section-header {
    background: var(--vm-bg-soft);
    border-bottom: 1px solid var(--vm-border);
    padding: 14px 24px;
}
.vm-section-header__title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--vm-navy) !important;
    margin: 0 !important;
    padding: 0 !important;
}
.vm-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--vm-blue);
    color: var(--vm-white) !important;
    border-radius: 50%;
    font-size: 13px !important;
    font-weight: 700;
    flex-shrink: 0;
}
.vm-section-header__desc {
    font-size: 13px !important;
    color: var(--vm-text-mid) !important;
    margin: 5px 0 0 38px !important;
    line-height: 1.6;
}
.vm-section-header__desc a {
    color: var(--vm-blue) !important;
    font-weight: 600;
    text-decoration: none;
}
.vm-section-header__desc a:hover {
    text-decoration: underline;
}
.vm-section-body {
    padding: 22px 24px;
}

/* ── Fields ─────────────────────────────────────────────────── */
.vm-field-group {
    margin-bottom: 22px;
}
.vm-field-group:last-child { margin-bottom: 0; }

.vm-label {
    display: block;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--vm-text) !important;
    margin-bottom: 8px !important;
    line-height: 1.4;
}
.vm-label--required::after {
    content: ' *';
    color: var(--vm-red) !important;
}
.vm-label__price {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--vm-blue) !important;
    background: #e8f4fb;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

/* Inputs — !important beats Avada's overrides */
.vm-application-form-wrap .vm-input,
.vm-application-form-wrap .vm-textarea {
    width: 100% !important;
    padding: 11px 14px !important;
    border: 1.5px solid var(--vm-border) !important;
    border-radius: var(--vm-radius-sm) !important;
    font-size: 15px !important;
    color: var(--vm-text) !important;
    background: var(--vm-white) !important;
    box-sizing: border-box !important;
    font-family: 'Open Sans', sans-serif !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none !important;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}
.vm-application-form-wrap .vm-input:focus,
.vm-application-form-wrap .vm-textarea:focus {
    border-color: var(--vm-blue) !important;
    box-shadow: 0 0 0 3px rgba(0,125,197,0.15) !important;
}
.vm-application-form-wrap .vm-number {
    max-width: 140px !important;
    text-align: center !important;
}
.vm-application-form-wrap .vm-textarea {
    resize: vertical !important;
    min-height: 100px;
}

/* Select — !important beats Avada */
.vm-application-form-wrap .vm-select {
    width: 100% !important;
    padding: 11px 40px 11px 14px !important;
    border: 1.5px solid var(--vm-border) !important;
    border-radius: var(--vm-radius-sm) !important;
    font-size: 15px !important;
    color: var(--vm-text) !important;
    background-color: var(--vm-white) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    font-family: 'Open Sans', sans-serif !important;
    transition: border-color 0.15s;
    box-sizing: border-box !important;
}
.vm-application-form-wrap .vm-select:focus {
    border-color: var(--vm-blue) !important;
    box-shadow: 0 0 0 3px rgba(0,125,197,0.15) !important;
}

.vm-hint {
    display: block !important;
    font-size: 13px !important;
    color: var(--vm-text-light) !important;
    margin: 6px 0 0 !important;
    line-height: 1.55;
}

/* Input with unit suffix */
.vm-input-with-unit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.vm-input-unit {
    font-size: 14px !important;
    color: var(--vm-text-light) !important;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Validation errors ──────────────────────────────────────── */
.vm-field-error {
    display: block !important;
    font-size: 13px !important;
    font-weight: 500;
    color: var(--vm-red) !important;
    margin: 6px 0 0 !important;
    line-height: 1.4;
}
.vm-application-form-wrap .vm-input.is-invalid,
.vm-application-form-wrap .vm-textarea.is-invalid,
.vm-application-form-wrap .vm-select.is-invalid {
    border-color: var(--vm-red) !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important;
}
.vm-choice-group.is-invalid {
    outline: 2px solid var(--vm-red);
    outline-offset: 3px;
    border-radius: var(--vm-radius-sm);
}
#vm-amps-group.is-invalid {
    outline: 2px solid var(--vm-red);
    outline-offset: 3px;
    border-radius: var(--vm-radius-sm);
    padding: 6px;
}

/* ── Choice pills (radio) ────────────────────────────────────── */
.vm-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Standard horizontal pills */
.vm-choice-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px !important;
    border: 2px solid var(--vm-border) !important;
    border-radius: 50px !important;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500;
    color: var(--vm-text) !important;
    background: var(--vm-white) !important;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
    line-height: 1.3;
    position: relative;
}
.vm-choice-label:hover {
    border-color: var(--vm-blue) !important;
    background: #f0f8fd !important;
}
.vm-choice-label.is-checked {
    border-color: var(--vm-blue) !important;
    background: #e5f3fb !important;
    color: var(--vm-blue-dark) !important;
    font-weight: 700;
}
.vm-choice-label input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}
.vm-choice-label__price {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--vm-green-dark) !important;
    background: #f0f9e6;
    border: 1px solid var(--vm-green);
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 4px;
}
.is-checked .vm-choice-label__price {
    background: #dff0c0;
}

/* Card-style pills for space type — stacked layout */
.vm-choice-group--stacked {
    flex-direction: column;
    gap: 10px;
}
.vm-choice-label--card {
    border-radius: var(--vm-radius-sm) !important;
    padding: 14px 16px !important;
    gap: 12px;
    align-items: flex-start;
}
.vm-choice-label--card.is-checked {
    border-color: var(--vm-blue) !important;
    background: #e5f3fb !important;
}
.vm-choice-label__check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--vm-border);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    transition: border-color 0.15s, background 0.15s;
    background: var(--vm-white);
    position: relative;
}
.is-checked .vm-choice-label__check {
    border-color: var(--vm-blue) !important;
    background: var(--vm-blue) !important;
}
.is-checked .vm-choice-label__check::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    background: var(--vm-white);
    border-radius: 50%;
}
.vm-choice-label__content {
    flex: 1;
}
.vm-choice-label__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--vm-text) !important;
    line-height: 1.4;
}
.is-checked .vm-choice-label__title {
    color: var(--vm-blue-dark) !important;
}
.vm-choice-label__desc {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--vm-text-light) !important;
    margin-top: 2px;
    line-height: 1.4;
}

/* ── Electrical amps grid ───────────────────────────────────── */
.vm-amps-intro {
    font-size: 14px !important;
    color: var(--vm-text-mid) !important;
    margin: 0 0 16px !important;
    line-height: 1.5;
}
.vm-amps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}
.vm-amp-field .vm-label {
    font-size: 14px !important;
    font-weight: 600 !important;
}
.vm-amp-field .vm-input {
    max-width: 120px !important;
}

/* ── Live cost breakdown table ──────────────────────────────── */
.vm-cost-breakdown {
    background: var(--vm-white);
    border-radius: var(--vm-radius);
    box-shadow: var(--vm-shadow);
    margin-bottom: 18px;
    overflow: hidden;
}
.vm-cost-breakdown__title {
    background: var(--vm-navy);
    color: var(--vm-white) !important;
    font-size: 12px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 10px 20px;
}
.vm-cost-table {
    width: 100%;
    border-collapse: collapse;
}
.vm-cost-table td {
    padding: 10px 20px !important;
    font-size: 14px !important;
    color: var(--vm-text) !important;
    border-bottom: 1px solid #f3f4f6 !important;
    background: none !important;
    vertical-align: middle;
}
.vm-cost-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--vm-blue) !important;
    white-space: nowrap;
}
.vm-cost-total-row td {
    background: var(--vm-bg-soft) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-top: 2px solid var(--vm-border) !important;
    border-bottom: none !important;
}
.vm-cost-total-row td:last-child {
    font-size: 22px !important;
    color: var(--vm-navy) !important;
}


/* ── Submit ─────────────────────────────────────────────────── */
.vm-submit-wrap {
    padding: 6px 0 0;
}


/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .vm-section-body       { padding: 18px 18px; }
    .vm-section-header     { padding: 12px 18px; }
    .vm-choice-label       { padding: 9px 14px !important; font-size: 13px !important; }
    .vm-choice-label--card { padding: 12px 14px !important; }
    .vm-amps-grid          { grid-template-columns: 1fr; }
    .vm-total-bar          { padding: 14px 18px; gap: 10px; }
    .vm-total-bar__amount  { font-size: 26px !important; }
    .vm-submit-btn         { width: 100% !important; font-size: 16px !important; padding: 14px 28px !important; }
}
