/**
 * FixWater ZIP Form Styles
 * Dark theme, responsive design
 * Matched to fixwaterca.com reference styling
 */

/* === BASE FORM STYLES === */
.zip-form-card {
    background: rgba(20, 20, 40, 0.88) !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    padding: 32px !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
}

.zip-form-card.highlighted {
    border: 2px solid #1a6fd4 !important;
    box-shadow: 0 0 0 4px rgba(26, 111, 212, 0.4) !important;
}

.zip-form-card h3 {
    color: #ffffff !important;
    font-size: 24px !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
}

.zip-form-card .subtitle {
    color: #cccccc !important;
    font-size: 14px !important;
    margin-bottom: 24px !important;
}

.zip-form-card input {
    width: 100% !important;
    height: 48px !important;
    padding: 0 16px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    margin-bottom: 16px !important;
}

.zip-form-card input:focus {
    outline: none !important;
    border-color: #1a6fd4 !important;
}

.zip-form-card button {
    width: 100% !important;
    height: 48px !important;
    background: #1a6fd4 !important;
    border: none !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
}

.zip-form-card button:hover {
    background: #1558a8 !important;
}

/* === RECAPTCHA WRAPPER === */
.recaptcha-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 16px 0 !important;
    min-height: 80px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    transform: none !important;
    transform-origin: center !important;
    contain: layout !important;
    /* Dark theme styling */
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
}

/* === RECAPTCHA WIDGET - DYNAMIC SCALING (V17) === */
/* JavaScript handles scaling based on wrapper width - no hardcoded breakpoints */
/* JS uses setProperty with 'important' to apply transform dynamically */
.g-recaptcha {
    overflow: visible !important;
    transform-origin: center center !important;
    transition: transform 0.1s ease-out !important;
}

/* === SUBMIT BUTTON === */
.zip-form-card button[type="submit"] {
    width: 100% !important;
    height: 48px !important;
    background: #1a6fd4 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
}

.zip-form-card button[type="submit"]:hover:not(:disabled) {
    background: #1558a8 !important;
}

.zip-form-card button[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* === PHONE BUTTON === */
#zipPhoneNumber {
    display: none !important;
    margin-top: 16px !important;
    height: 48px !important;
    background: #1a6fd4 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: all 0.3s !important;
    white-space: nowrap !important;
    letter-spacing: 0.3px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
}

#zipPhoneNumber span {
    color: #ffffff !important;
}

#zipPhoneNumber svg {
    fill: #ffffff !important;
}

#zipPhoneNumber:hover {
    background: #1558a8 !important;
}

#zipPhoneNumber svg {
    fill: #ffffff !important;
    pointer-events: none !important;
}

#zipPhoneNumber span {
    color: #ffffff !important;
}

/* === SUCCESS MESSAGE === */
#zipSuccessMessage {
    display: none !important;
    margin-top: 14px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #4caf50 !important;
    text-align: center !important;
}

/* === TIMING LINE === */
#zipTimingLine {
    display: none !important;
    margin-top: 8px !important;
    font-size: 13px !important;
    color: #90a4ae !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

/* === ZIP RESULT === */
.zip-result {
    color: #e0e0e0 !important;
    font-weight: 600 !important;
    margin-top: 16px !important;
    font-size: 14px !important;
}



/* === MOBILE RESPONSIVE (@media max-width: 768px) === */
@media (max-width: 768px) {
    /* Form card - reduce padding */
    .zip-form-card {
        padding: 24px 20px !important;
    }
    
    .zip-form-card h3 {
        font-size: 22px !important;
    }
    
    .zip-form-card .subtitle {
        font-size: 13px !important;
    }
    
    .zip-form-card input {
        font-size: 15px !important;
        padding: 0 14px !important;
        height: 44px !important;
    }
    
    /* RECAPTCHA WRAPPER - centered, no transform (CSS clamp() handles scaling) */
    .recaptcha-wrapper {
        min-height: 80px !important;
        transform: none !important;
        transform-origin: center center !important;
        margin-bottom: 16px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: visible !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* SUBMIT BUTTON - allow text wrapping, ensure proper hide */
    .zip-form-card button[type="submit"] {
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.3 !important;
        padding: 0 12px !important;
        font-size: 14px !important;
        min-height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
    }
    
    /* When hidden via JS, ensure it stays hidden */
    .zip-form-card button[type="submit"][style*="display: none"] {
        display: none !important;
    }
    
    /* Phone button - ensure full width */
    #zipPhoneNumber {
        font-size: 14px !important;
        padding: 10px 14px !important;
    }
    
    /* Success message - ensure visibility */
    #zipSuccessMessage {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    /* Timing line - ensure proper wrapping */
    #zipTimingLine {
        font-size: 12px !important;
        flex-wrap: wrap !important;
    }
}

/* === EXTRA SMALL MOBILE (@media max-width: 480px) === */
@media (max-width: 480px) {
    .zip-form-card {
        padding: 20px 16px !important;
        border-radius: 10px !important;
    }
    
    .zip-form-card h3 {
        font-size: 20px !important;
    }
    
    /* RECAPTCHA - clamp() handles scaling automatically */
    .recaptcha-wrapper {
        min-height: 74px !important;
    }
    
    /* SUBMIT BUTTON - more compact */
    .zip-form-card button[type="submit"] {
        font-size: 13px !important;
        padding: 0 10px !important;
        min-height: 56px !important;
        height: auto !important;
    }
    
    #zipPhoneNumber {
        font-size: 13px !important;
        padding: 9px 12px !important;
    }
}
