/**
 * Multi-Step Gravity Form Styles
 * EVIST EV Charger Installation Form
 *
 * Brand Colors:
 * - Primary Green: #1FFC4D
 * - Primary Accent: #8FFDA6
 * - Dark Blue: #0B1D2D
 * - Light Gray: #F5F5F5
 */

/* ===============================================
   CSS VARIABLES
   =============================================== */
:root {
    --msgf-primary: #1FFC4D;
    --msgf-primary-hover: #18E045;
    --msgf-primary-accent: #8FFDA6;
    --msgf-dark: #0B1D2D;
    --msgf-dark-secondary: #374955;
    --msgf-light: #F5F5F5;
    --msgf-white: #ffffff;
    --msgf-gray: #666666;
    --msgf-border: #E0E0E0;
    --msgf-accent-teal: #45C4B0;
    --msgf-accent-mint: #8FFDA6;
    --msgf-accent-cyan: #7DE3E1;
    --msgf-error: #DC3545;
    --msgf-success: #28A745;
    --msgf-radius: 12px;
    --msgf-transition: 0.3s ease;
}

/* ===============================================
   FORM WRAPPER & LAYOUT
   =============================================== */
.msgf-quote-form,
.msgf-quote-form * {
    box-sizing: border-box;
}

/* Main container - matches CBS approach */
.msgf-quote-form {
    max-width: 100%;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.msgf-quote-form .gform_wrapper {
    max-width: 100%;
}

/* Content area */
.msgf-quote-form .gform_body {
    padding: 40px 80px 100px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.msgf-quote-form .gform_page_fields {
    min-height: 50vh;
}

@media (max-width: 768px) {
    .msgf-quote-form .gform_page_fields {
        min-height: auto;
    }
}

/* Sidebar layout - only for details/payment pages */
.msgf-quote-form.has-sidebar .gform_body {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    max-width: 1200px;
}

@media (max-width: 1024px) {
    .msgf-quote-form .gform_body,
    .msgf-quote-form.has-sidebar .gform_body {
        display: block;
        padding: 30px 20px 80px;
        max-width: 100%;
    }

    .msgf-quote-form .gform_page_footer,
    .msgf-quote-form .gform_footer {
        padding: 15px 20px;
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        max-width: calc(100% + 40px);
    }
}

/* Form pages - flex to fill space, grid column 1 when sidebar */
.msgf-quote-form.has-sidebar .gform_page {
    grid-column: 1;
}

/* ===============================================
   STEP INDICATOR BAR - Sticky at top
   =============================================== */
.msgf-quote-form .msgf-step-indicator,
.msgf-step-indicator {
    background: #000000;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 0 0 40px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

/* Inner container to align steps with form content */
.msgf-quote-form .msgf-step-indicator-inner {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: nowrap;
    max-width: 1200px;
    width: 100%;
    padding: 0 80px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .msgf-quote-form .msgf-step-indicator-inner {
        max-width: none !important;
        width: auto !important;
        padding: 0 !important;
    }
}

.msgf-step-indicator .step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
    transition: var(--msgf-transition);
}

.msgf-step-indicator .step-item .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    color: #000000;
    text-align: center;
    line-height: 28px;
}

.msgf-step-indicator .step-item.active {
    color: var(--msgf-white);
}

.msgf-step-indicator .step-item.active .step-number {
    background: var(--msgf-primary);
    color: #000000;
}

.msgf-step-indicator .step-item.completed {
    color: var(--msgf-accent-mint);
}

.msgf-step-indicator .step-item.completed .step-number {
    background: var(--msgf-accent-mint);
    color: #000000;
}

@media (max-width: 768px) {
    .msgf-quote-form .msgf-step-indicator,
    .msgf-step-indicator {
        padding: 15px 20px !important;
        margin: 0 0 15px 0 !important;
    }

    .msgf-step-indicator .step-item .step-label {
        display: none !important;
    }
}

/* Prevent horizontal scroll on mobile - use clip instead of hidden to preserve sticky */
@media (max-width: 768px) {
    html, body {
        overflow-x: clip;
    }

    .msgf-quote-form,
    .msgf-quote-form .gform_wrapper,
    .msgf-quote-form .gform_body {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .msgf-quote-form .gform_body {
        padding: 20px 15px 80px !important;
    }
}

/* ===============================================
   SIDEBAR - Hidden until pages 9+
   =============================================== */
.msgf-form-sidebar {
    display: none !important;
}

/* Show sidebar only when form has .has-sidebar class */
.msgf-quote-form.has-sidebar .msgf-form-sidebar {
    display: block !important;
    background: #1a2634 !important;
    color: #ffffff !important;
    padding: 30px !important;
    border-radius: 12px !important;
    position: sticky !important;
    top: 100px !important;
    align-self: start !important;
}

/* Make form body a grid when sidebar is visible */
.msgf-quote-form.has-sidebar .gform_body {
    display: grid !important;
    grid-template-columns: 1fr 320px !important;
    gap: 40px !important;
}

@media (max-width: 1024px) {
    /* Single column layout on mobile */
    .msgf-quote-form.has-sidebar .gform_body {
        display: block !important;
        grid-template-columns: none !important;
    }

    /* Show sidebar on mobile - just change layout to stack below form */
    .msgf-quote-form.has-sidebar .msgf-form-sidebar {
        display: block !important;
        position: static !important;
        margin-top: 20px !important;
        margin-bottom: 100px !important;
        border-radius: 12px !important;
        background: #1a2634 !important;
        color: #ffffff !important;
        padding: 20px !important;
    }

    /* Hide Q&A selections on mobile - just show price */
    .msgf-quote-form.has-sidebar .msgf-form-sidebar .sidebar-selections {
        display: none !important;
    }

    /* Hide product specs on mobile to keep it compact */
    .msgf-quote-form.has-sidebar .msgf-form-sidebar .product-specs-mini {
        display: none !important;
    }
}

/* Sidebar Product Summary */
.sidebar-product-summary {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-product-summary h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.sidebar-product-summary .product-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 15px 0;
}

.sidebar-product-summary .product-specs-mini .spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-product-summary .product-specs-mini .spec-row:last-child {
    border-bottom: none;
}

/* Sidebar Price Summary */
.sidebar-price-summary {
    background: rgba(0, 166, 81, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sidebar-price-summary .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-price-summary .price {
    font-size: 24px;
    font-weight: 700;
    color: var(--msgf-primary);
}

.sidebar-price-summary .includes-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 5px 0 0 0;
}

/* Sidebar Selections */
.sidebar-selections h5 {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.selection-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    line-height: 1.4;
}

.selection-item:last-child {
    border-bottom: none;
}

.selection-label {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.selection-label::after {
    content: ': ';
}

.selection-value {
    color: #ffffff;
    font-weight: 600;
}

/* ===============================================
   SECTION TITLES
   =============================================== */
.msgf-quote-form .gsection,
.msgf-quote-form .step-section-title {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 30px 0 !important;
}

.msgf-quote-form .gsection_title {
    font-size: 36px !important;
    font-weight: 400 !important;
    color: var(--msgf-dark) !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.2 !important;
    border: none !important;
}

.msgf-quote-form .gsection_title strong {
    font-weight: 700 !important;
}

.msgf-quote-form .gsection_description {
    font-size: 16px !important;
    color: var(--msgf-gray) !important;
    margin: 0 !important;
}

@media (max-width: 768px) {
    .msgf-quote-form .gsection_title {
        font-size: 28px !important;
    }
}

/* ===============================================
   CARD SELECTION (Radio buttons as cards)
   =============================================== */
.msgf-quote-form .card-selection {
    margin-bottom: 40px !important;
}

.msgf-quote-form .card-selection .gfield_label,
.msgf-quote-form .card-selection legend.gfield_label {
    display: none !important;
}

.msgf-quote-form .card-selection .gfield_radio {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
}

.msgf-quote-form .card-selection .gchoice,
.msgf-quote-form .gform_legacy_markup_wrapper ul.gfield_radio li {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    height: 100% !important;
    overflow: visible !important;
}

.msgf-quote-form .card-selection .gchoice input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.msgf-quote-form .card-selection .gchoice label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 30px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all var(--msgf-transition) !important;
    background: var(--msgf-white) !important;
    border: 2px solid var(--msgf-border) !important;
    border-radius: var(--msgf-radius) !important;
    min-height: 160px !important;
    height: 100% !important;
    width: 100% !important;
    font-weight: 600 !important;
    font-size: 20px !important;
    color: var(--msgf-dark) !important;
    box-sizing: border-box !important;
}

.msgf-quote-form .card-selection .gchoice label:hover {
    border-color: var(--msgf-primary) !important;
    box-shadow: 0 4px 20px rgba(31, 252, 77, 0.2);
}

.msgf-quote-form .card-selection .gchoice label.selected,
.msgf-quote-form .card-selection .gchoice input[type="radio"]:checked + label {
    background: #000000 !important;
    border-color: var(--msgf-primary) !important;
    color: #ffffff !important;
}

/* Card icons (inline SVG) */
.msgf-quote-form .card-selection .card-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 15px !important;
    line-height: 1 !important;
    width: 48px !important;
    height: 48px !important;
}

.msgf-quote-form .card-selection .card-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 15px !important;
}

.msgf-quote-form .card-selection .card-icon img,
.card-icon-img {
    display: block !important;
    width: 40px !important;
    height: 40px !important;
    /* Default: black (no filter needed, SVGs are already black) */
}

/* Selected state - icon turns white */
.msgf-quote-form .card-selection .gchoice label.selected .card-icon img,
.msgf-quote-form .card-selection .gchoice input[type="radio"]:checked + label .card-icon img {
    filter: brightness(0) invert(1) !important;
}

.msgf-quote-form .card-selection .card-description {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--msgf-gray);
    margin-top: 10px;
}

/* Selected state - description turns white */
.msgf-quote-form .card-selection .gchoice label.selected .card-description,
.msgf-quote-form .card-selection .gchoice input[type="radio"]:checked + label .card-description {
    color: rgba(255, 255, 255, 0.7);
}

/* 2-column cards for Yes/No */
.msgf-quote-form .card-selection.step-off_street_parking .gfield_radio,
.msgf-quote-form .card-selection.step-property_type .gfield_radio {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 700px;
}

@media (max-width: 400px) {
    .msgf-quote-form .card-selection.step-off_street_parking .gfield_radio,
    .msgf-quote-form .card-selection.step-property_type .gfield_radio {
        grid-template-columns: 1fr !important;
    }
}

/* 4-column cards */
.msgf-quote-form .card-selection.step-installation_location .gfield_radio,
.msgf-quote-form .card-selection.step-fusebox_distance .gfield_radio {
    grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 900px) {
    .msgf-quote-form .card-selection.step-installation_location .gfield_radio,
    .msgf-quote-form .card-selection.step-fusebox_distance .gfield_radio {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 500px) {
    .msgf-quote-form .card-selection .gfield_radio {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .msgf-quote-form .card-selection .gchoice label {
        padding: 20px 15px !important;
        min-height: auto !important;
        font-size: 16px !important;
    }

    .msgf-quote-form .card-selection .card-icon {
        margin-bottom: 10px !important;
        width: 32px !important;
        height: 32px !important;
    }

    .msgf-quote-form .card-selection .card-icon svg,
    .msgf-quote-form .card-selection .card-icon img {
        width: 26px !important;
        height: 26px !important;
    }

    .msgf-quote-form .card-selection .card-description {
        font-size: 12px;
    }
}

/* ===============================================
   TERMINAL PAGES
   =============================================== */
.msgf-terminal-page {
    text-align: center;
    padding: 60px 40px;
    max-width: 600px;
    margin: 0 auto;
}

.msgf-terminal-page .terminal-icon {
    font-size: 64px;
    margin-bottom: 30px;
    color: var(--msgf-primary);
}

.msgf-terminal-page .terminal-heading {
    font-size: 32px;
    font-weight: 700;
    color: var(--msgf-dark);
    margin: 0 0 20px 0;
}

.msgf-terminal-page .terminal-message {
    font-size: 18px;
    color: var(--msgf-gray);
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.msgf-terminal-page .terminal-contact {
    background: var(--msgf-light);
    padding: 25px;
    border-radius: var(--msgf-radius);
    margin-bottom: 30px;
}

.msgf-terminal-page .terminal-contact p {
    margin: 10px 0;
}

.msgf-terminal-page .terminal-contact a {
    color: var(--msgf-primary);
    text-decoration: none;
    font-weight: 600;
}

.msgf-terminal-page .terminal-contact a:hover {
    text-decoration: underline;
}

.msgf-terminal-page .terminal-back-btn {
    background: transparent;
    color: var(--msgf-dark);
    border: 2px solid var(--msgf-dark);
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--msgf-transition);
}

.msgf-terminal-page .terminal-back-btn:hover {
    background: var(--msgf-dark);
    color: var(--msgf-white);
}

/* ===============================================
   POSTCODE LOOKUP
   =============================================== */
.msgf-quote-form .postcode-field {
    margin-bottom: 20px !important;
}

.msgf-quote-form .postcode-field .ginput_container {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.msgf-quote-form .postcode-field input {
    flex: 1;
    max-width: 200px;
    min-width: 150px;
}

.postcode-lookup-btn {
    background: var(--msgf-primary) !important;
    color: var(--msgf-dark) !important;
    border: none !important;
    padding: 15px 25px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: var(--msgf-transition) !important;
    white-space: nowrap !important;
    display: inline-block !important;
    text-align: center !important;
    line-height: 1.2 !important;
    height: auto !important;
    flex-shrink: 0 !important;
}

.postcode-lookup-btn:hover {
    background: var(--msgf-primary-hover) !important;
    transform: translateY(-1px);
}

.postcode-lookup-btn:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

@media (max-width: 500px) {
    .msgf-quote-form .postcode-field input {
        max-width: 100%;
        width: 100%;
    }

    .postcode-lookup-btn {
        width: 100% !important;
        margin-top: 10px !important;
    }
}

.postcode-error {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 15px 25px;
    background: var(--msgf-dark);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===============================================
   PRODUCT SELECTION CARDS (variant selector)
   =============================================== */
.msgf-product-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .msgf-product-cards {
        grid-template-columns: 1fr;
    }
}

.msgf-product-cards .product-card {
    position: relative;
    background: var(--msgf-white);
    border: 2px solid var(--msgf-border);
    border-radius: var(--msgf-radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.msgf-product-cards .product-card:hover {
    border-color: var(--msgf-gray);
}

.msgf-product-cards .product-card.selected {
    border-color: var(--msgf-primary);
    box-shadow: 0 0 0 1px var(--msgf-primary);
}

.msgf-product-cards .product-card-check {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    border: 2px solid var(--msgf-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--msgf-white);
    transition: all 0.2s ease;
}

.msgf-product-cards .product-card-check svg {
    width: 16px;
    height: 16px;
    opacity: 0;
    color: var(--msgf-white);
    transition: opacity 0.2s ease;
}

.msgf-product-cards .product-card.selected .product-card-check {
    background: var(--msgf-primary);
    border-color: var(--msgf-primary);
}

.msgf-product-cards .product-card.selected .product-card-check svg {
    opacity: 1;
}

.msgf-product-cards .product-card-image {
    text-align: center;
    margin-bottom: 15px;
    padding: 20px;
    background: var(--msgf-light);
    border-radius: 8px;
}

.msgf-product-cards .product-card-image img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.msgf-product-cards .product-card-content {
    text-align: center;
}

.msgf-product-cards .product-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--msgf-dark);
    margin: 0 0 8px 0;
}

.msgf-product-cards .product-card-desc {
    font-size: 14px;
    color: var(--msgf-gray);
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.msgf-product-cards .product-card-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--msgf-dark);
}

/* Hide the actual radio buttons for product selection */
.msgf-quote-form .product-selection-radio {
    display: none !important;
}

/* ===============================================
   PRODUCT DISPLAY (only visible on its own page)
   =============================================== */
.msgf-product-display {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    background: var(--msgf-white);
    border: 2px solid var(--msgf-border);
    border-radius: var(--msgf-radius);
    padding: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .msgf-product-display {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.msgf-product-display .product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--msgf-light);
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
}

.msgf-product-display .product-image img {
    max-width: 100%;
    height: auto;
}

.msgf-product-display .product-image-placeholder {
    width: 150px;
    height: 150px;
    background: var(--msgf-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msgf-product-display .product-info {
    display: flex;
    flex-direction: column;
}

.msgf-product-display .product-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--msgf-dark);
    margin: 0 0 5px 0;
}

.msgf-product-display .product-subtitle {
    font-size: 16px;
    color: var(--msgf-gray);
    margin: 0 0 20px 0;
}

.msgf-product-display .product-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.msgf-product-display .spec-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.msgf-product-display .spec-label {
    font-size: 12px;
    color: var(--msgf-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msgf-product-display .spec-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--msgf-dark);
}

.msgf-product-display .product-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.msgf-product-display .product-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--msgf-dark);
}

.msgf-product-display .feature-check {
    color: var(--msgf-primary);
    font-weight: 700;
}

.msgf-product-display .product-price {
    background: linear-gradient(135deg, var(--msgf-primary) 0%, var(--msgf-accent-teal) 100%);
    color: var(--msgf-dark);
    padding: 20px;
    border-radius: 8px;
    margin-top: auto;
}

.msgf-product-display .price-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.msgf-product-display .price-amount {
    display: block;
    font-size: 32px;
    font-weight: 700;
}

.msgf-product-display .price-includes {
    display: block;
    font-size: 13px;
    opacity: 0.8;
    margin-top: 5px;
}

/* ===============================================
   DATE PICKER
   =============================================== */
.msgf-quote-form .gfield--type-date {
    margin-bottom: 20px !important;
}

.msgf-quote-form .gfield--type-date .gfield_label {
    position: static !important;
    margin-bottom: 10px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--msgf-dark) !important;
}

.msgf-quote-form .gfield--type-date input[type="text"],
.msgf-quote-form .ginput_container_date input {
    width: 100% !important;
    max-width: 300px !important;
    padding: 18px !important;
    min-height: 56px !important;
}

/* Date picker icon */
.msgf-quote-form .gfield--type-date .ui-datepicker-trigger,
.msgf-quote-form .ginput_container_date img {
    display: none !important;
}

.msgf-quote-form .time-slot-field .gfield_radio {
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.msgf-quote-form .time-slot-field .gchoice {
    flex: 1;
    min-width: 180px;
}

/* Form field labels - visible */
.msgf-quote-form .gfield_label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--msgf-dark) !important;
    margin: 0 0 8px 0 !important;
}

/* Hide address select label only */
.msgf-quote-form .address-select-field .gfield_label {
    display: none !important;
}

/* Hide placeholders when labels are visible */
.msgf-quote-form input::placeholder,
.msgf-quote-form textarea::placeholder,
.msgf-quote-form .gform_wrapper input::placeholder,
.msgf-quote-form .gform_wrapper textarea::placeholder,
.msgf-quote-form .ginput_container input::placeholder,
.msgf-quote-form .ginput_container textarea::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

.msgf-quote-form input::-webkit-input-placeholder,
.msgf-quote-form textarea::-webkit-input-placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

.msgf-quote-form input::-moz-placeholder,
.msgf-quote-form textarea::-moz-placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

/* Required indicator styling */
.msgf-quote-form .gfield_required {
    color: var(--msgf-error) !important;
    margin-left: 2px !important;
}

/* Loading state for payment processing */
.msgf-quote-form.is-submitting {
    pointer-events: none;
    position: relative;
}

.msgf-quote-form.is-submitting::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9998;
}

.msgf-loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    text-align: center;
    background: #ffffff;
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.msgf-loading-overlay .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--msgf-primary);
    border-radius: 50%;
    animation: msgf-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.msgf-loading-overlay .loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--msgf-dark);
}

@keyframes msgf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===============================================
   ORDER SUMMARY
   =============================================== */
.msgf-order-summary {
    background: var(--msgf-light);
    border-radius: var(--msgf-radius);
    padding: 25px;
    margin-bottom: 30px;
}

.msgf-order-summary h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--msgf-dark);
    margin: 0 0 20px 0;
}

.msgf-order-summary .order-line {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--msgf-border);
}

.msgf-order-summary .order-line.included {
    color: var(--msgf-gray);
}

.msgf-order-summary .order-line.included .order-price {
    color: var(--msgf-success);
}

.msgf-order-summary .order-total {
    display: flex;
    justify-content: space-between;
    padding: 15px 0 0 0;
    margin-top: 10px;
    font-size: 18px;
    font-weight: 700;
}

.msgf-order-summary .total-amount {
    color: var(--msgf-primary);
    font-size: 24px;
}

/* ===============================================
   FORM FIELDS (Text inputs, selects)
   =============================================== */
.msgf-quote-form .gfield {
    margin-bottom: 25px !important;
    position: relative;
}

.msgf-quote-form .gfield_label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--msgf-dark) !important;
    margin-bottom: 8px !important;
    display: block !important;
}

.msgf-quote-form input[type="text"],
.msgf-quote-form input[type="email"],
.msgf-quote-form input[type="tel"],
.msgf-quote-form input[type="date"],
.msgf-quote-form select,
.msgf-quote-form textarea {
    width: 100% !important;
    padding: 20px 18px !important;
    min-height: 60px !important;
    border: 2px solid var(--msgf-border) !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    color: var(--msgf-dark) !important;
    background: var(--msgf-white) !important;
    transition: var(--msgf-transition) !important;
    box-sizing: border-box !important;
}

.msgf-quote-form input::placeholder,
.msgf-quote-form textarea::placeholder {
    color: var(--msgf-gray) !important;
    opacity: 1 !important;
}

.msgf-quote-form input:focus,
.msgf-quote-form select:focus,
.msgf-quote-form textarea:focus {
    outline: none !important;
    border-color: var(--msgf-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1) !important;
}

.msgf-quote-form select {
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374955' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    padding-right: 45px !important;
}

/* Address select dropdown */
.msgf-quote-form .address-select-field select {
    width: 100% !important;
    padding: 18px 45px 18px 18px !important;
    font-size: 16px !important;
    min-height: 56px !important;
    cursor: pointer !important;
}

/* Field widths */
.msgf-quote-form .field-width-half {
    width: calc(50% - 10px) !important;
    display: inline-block !important;
    vertical-align: top !important;
}

.msgf-quote-form .field-width-half:nth-of-type(odd) {
    margin-right: 20px !important;
}

@media (max-width: 600px) {
    .msgf-quote-form .field-width-half {
        width: 100% !important;
        display: block !important;
        margin-right: 0 !important;
    }
}

/* Floating labels */
.msgf-quote-form .gfield.floating-label-ready .gfield_label {
    position: absolute !important;
    top: 15px !important;
    left: 18px !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    color: var(--msgf-gray) !important;
    pointer-events: none !important;
    transition: all 0.2s ease !important;
    z-index: 1 !important;
    background: transparent !important;
}

.msgf-quote-form .gfield.floating-label-ready.field-focused .gfield_label,
.msgf-quote-form .gfield.floating-label-ready.field-has-value .gfield_label {
    top: -10px !important;
    left: 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--msgf-primary) !important;
    background: var(--msgf-white) !important;
    padding: 0 6px !important;
}

/* Help text */
.msgf-help-text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 166, 81, 0.08);
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--msgf-dark);
    line-height: 1.5;
}

/* Help text field wrapper - remove extra margin */
.msgf-quote-form .gfield[class*="helptext-"] {
    margin-bottom: 0 !important;
}

.msgf-help-text .help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--msgf-primary);
    color: var(--msgf-white);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===============================================
   TERMS CHECKBOX
   =============================================== */
.msgf-quote-form .terms-checkbox-field {
    margin-top: 20px !important;
}

.msgf-quote-form .terms-checkbox-field .gfield_label {
    display: none !important;
}

.msgf-quote-form .terms-checkbox-field .gchoice {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

.msgf-quote-form .terms-checkbox-field input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.msgf-quote-form .terms-checkbox-field label {
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: var(--msgf-gray) !important;
}

.msgf-quote-form .terms-checkbox-field a {
    color: var(--msgf-primary);
    text-decoration: underline;
}

/* ===============================================
   BUTTONS - Sticky at bottom (matches CBS)
   =============================================== */
.msgf-quote-form .gform_page_footer,
.msgf-quote-form .gform_footer,
.msgf-quote-form .gform_legacy_markup_wrapper .gform_page_footer {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 30px 0 40px 0 !important;
    margin-top: 40px;
    z-index: 100;
    border-top: 1px solid var(--msgf-border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

/* When Back button exists, space between */
.msgf-quote-form .gform_page_footer:has(.gform_previous_button) {
    justify-content: space-between;
}

.msgf-quote-form .gform_next_button,
.msgf-quote-form .gform_button {
    background: var(--msgf-primary) !important;
    color: var(--msgf-dark) !important;
    padding: 16px 50px !important;
    border-radius: 50px !important;
    border: none !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all var(--msgf-transition) !important;
    min-width: 180px !important;
}

.msgf-quote-form .gform_next_button:hover,
.msgf-quote-form .gform_button:hover {
    background: var(--msgf-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(31, 252, 77, 0.4);
}

.msgf-quote-form .gform_previous_button {
    background: transparent !important;
    color: var(--msgf-dark) !important;
    padding: 16px 50px !important;
    border-radius: 50px !important;
    border: 2px solid var(--msgf-dark) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all var(--msgf-transition) !important;
    min-width: 150px !important;
}

.msgf-quote-form .gform_previous_button:hover {
    background: var(--msgf-dark) !important;
    color: var(--msgf-white) !important;
}

/* Loading spinner - completely remove from layout */
.msgf-quote-form .gform_ajax_spinner,
.msgf-quote-form .gform-ajax-spinner,
.msgf-quote-form .gf-spinner,
.msgf-quote-form img[src*="spinner"],
.msgf-quote-form .gform_page_footer img,
.msgf-quote-form .gform_footer img,
.gform_ajax_spinner,
img.gform_ajax_spinner,
.msgf-quote-form .gform_page_footer img[src*="spinner"],
.msgf-quote-form input[type="submit"] + img,
.msgf-quote-form input[type="button"] + img,
.msgf-quote-form button + img,
.gform_wrapper img.gform_ajax_spinner {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    opacity: 0 !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0,0,0,0) !important;
    overflow: hidden !important;
    z-index: -9999 !important;
}

@media (max-width: 600px) {
    .msgf-quote-form .gform_page_footer,
    .msgf-quote-form .gform_footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        padding: 20px !important;
    }

    .msgf-quote-form .gform_next_button,
    .msgf-quote-form .gform_button {
        flex: 1 !important;
        text-align: center !important;
        padding: 14px 20px !important;
        min-width: unset !important;
    }

    .msgf-quote-form .gform_previous_button {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        padding: 0 !important;
        font-size: 0 !important;
        color: transparent !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230B1D2D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        background-color: transparent !important;
    }
}

/* ===============================================
   PROGRESS BAR
   =============================================== */
.msgf-quote-form .gf_progressbar_wrapper {
    display: none !important;
}

/* ===============================================
   VALIDATION ERRORS - Toast style
   =============================================== */
.msgf-quote-form .gfield_error input,
.msgf-quote-form .gfield_error select,
.msgf-quote-form .gfield_error textarea {
    border-color: var(--msgf-error) !important;
}

.msgf-quote-form .gfield_error .gfield_label {
    color: var(--msgf-error) !important;
}

/* Hide default inline validation messages - EXCEPT Stripe/payment fields */
.msgf-quote-form .validation_message,
.msgf-quote-form .gfield_validation_message {
    display: none !important;
}

/* Show Stripe/payment validation messages */
.msgf-quote-form .gfield_stripe_creditcard .validation_message,
.msgf-quote-form .gfield_stripe_creditcard .gfield_validation_message,
.msgf-quote-form .ginput_container_creditcard .validation_message,
.msgf-quote-form [class*="stripe"] .validation_message,
.msgf-quote-form [class*="stripe"] .gfield_validation_message,
.msgf-quote-form .gfield_creditcard .validation_message,
.msgf-quote-form .gfield_error[class*="stripe"] .validation_message,
.msgf-quote-form .gfield--type-stripe_creditcard .validation_message,
.msgf-quote-form .gfield--type-stripe_creditcard .gfield_validation_message {
    display: block !important;
    color: var(--msgf-error) !important;
    font-size: 13px !important;
    margin-top: 8px !important;
}

/* Hide the default validation error box at top */
.msgf-quote-form .gform_validation_errors,
.msgf-quote-form .validation_error,
.gform_validation_errors,
.gform_wrapper .gform_validation_errors,
#gform_3_validation_container,
[id*="_validation_container"],
.gform_submission_error {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Toast-style validation error */
.msgf-validation-toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 15px 25px;
    background: var(--msgf-error);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: toastInTop 0.3s ease;
    max-width: 90%;
    text-align: center;
}

@keyframes toastInTop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===============================================
   MANUAL ADDRESS FIELDS
   =============================================== */
.msgf-manual-address-fields {
    margin-top: 20px;
    padding: 20px;
    background: var(--msgf-light);
    border-radius: var(--msgf-radius);
    border: 1px solid var(--msgf-border);
}

.msgf-manual-address-fields .manual-address-field {
    margin-bottom: 15px;
}

.msgf-manual-address-fields .manual-address-field:last-child {
    margin-bottom: 0;
}

.msgf-manual-address-fields .gfield_label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--msgf-dark);
    margin-bottom: 6px;
}

.msgf-manual-address-fields .gfield_required {
    color: var(--msgf-error);
}

.msgf-manual-address-fields input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--msgf-border);
    border-radius: var(--msgf-radius);
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.msgf-manual-address-fields input:focus {
    outline: none;
    border-color: var(--msgf-primary);
    box-shadow: 0 0 0 3px rgba(0, 163, 81, 0.1);
}

.msgf-manual-address-fields input::placeholder {
    color: #999;
}

/* Postcode actions container */
.postcode-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-top: 15px !important;
    width: 100%;
}

.postcode-actions .postcode-lookup-btn {
    display: inline-block !important;
}

/* Manual entry link styling */
.postcode-actions .manual-address-link {
    display: block !important;
    color: #000000 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.postcode-actions .manual-address-link:hover {
    text-decoration: underline !important;
}

/* ===============================================
   PAYMENT PLACEHOLDER
   =============================================== */
.msgf-payment-placeholder {
    background: var(--msgf-light);
    border: 2px dashed var(--msgf-border);
    border-radius: var(--msgf-radius);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.msgf-payment-placeholder .payment-note {
    color: var(--msgf-gray);
    font-size: 14px;
}

.msgf-payment-placeholder a {
    color: var(--msgf-primary);
}

/* ===============================================
   ANIMATIONS
   =============================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msgf-quote-form .gform_page {
    animation: fadeInUp 0.4s ease;
}

/* ===============================================
   RESPONSIVE ADJUSTMENTS
   =============================================== */
@media (max-width: 768px) {
    .msgf-quote-form .gform_body {
        padding: 20px 15px 80px !important;
    }

    /* Reduce row gap on mobile */
    .msgf-quote-form .gform_fields,
    .msgf-quote-form .gform-theme--foundation .gform_fields {
        row-gap: 10px !important;
    }

    .msgf-quote-form .gsection_title {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    .msgf-quote-form .gsection_description {
        font-size: 14px !important;
    }

    .msgf-quote-form .card-selection .gchoice label {
        padding: 25px 20px !important;
        min-height: 120px !important;
        font-size: 18px !important;
    }
}

/* Mobile - remove card margins */
@media (max-width: 768px) {
    .msgf-quote-form .gfield.card-selection,
    .msgf-quote-form .card-selection,
    .msgf-quote-form .card-selection .gfield_radio,
    .msgf-quote-form .card-selection .gchoice,
    .msgf-quote-form .card-selection .gchoice label {
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    .msgf-product-display {
        padding: 20px;
    }

    .msgf-product-display .product-name {
        font-size: 20px;
    }

    .msgf-product-display .product-specs {
        grid-template-columns: 1fr;
    }

    .msgf-terminal-page {
        padding: 30px 15px;
    }

    .msgf-terminal-page .terminal-heading {
        font-size: 22px;
    }

    .msgf-terminal-page .terminal-message {
        font-size: 15px;
    }

    .msgf-quote-form input[type="text"],
    .msgf-quote-form input[type="email"],
    .msgf-quote-form input[type="tel"],
    .msgf-quote-form select,
    .msgf-quote-form textarea {
        padding: 12px 14px !important;
        font-size: 16px !important;
    }

    .msgf-help-text {
        padding: 12px;
        font-size: 13px;
    }

    .msgf-order-summary {
        padding: 20px 15px;
    }
}
