/* =========================================================================
   1. GENERAL STRUCTURE & CONTAINERS (RESPONSIVE LAYOUT)
   ========================================================================= */
/* Full unlock of field containers */
.whitetip-form-group {
    margin-bottom: 0px;
    box-sizing: border-box;
    min-width: 0 !important;
    /* Enables fluid shrinkage on desktop and tablet viewports */
}

/* RESPONSIVE DESIGN: Below 600px, override inline styles from PHP and force 1-column stack */
@media (max-width: 600px) {
    .whitetip-form-group {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =========================================================================
   2. CORE FORM ELEMENTS (INPUTS, LABELS, FEEDBACKS)
   ========================================================================= */
/* Structural reset for all internal input fields, select tags, and textareas */
.whitetip-form-group input,
.whitetip-form-group select,
.whitetip-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    min-width: 0 !important;
    /* Removes default implicit browser minimum width rules */
}

/* Submission triggers and message state elements */
.whitetip-submit-button {
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.whitetip-submit-button:disabled {
    background: #94a3b8;
}

.whitetip-form-response-message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: none;
}

.whitetip-form-response-message.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.whitetip-form-response-message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* =========================================================================
   3. UNIVERSAL GRAPHIC PATCHES FOR WP DATEPICKER CALENDAR
   ========================================================================= */
#ui-datepicker-div {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    padding: 12px !important;
    z-index: 999999 !important;
    /* Forces positioning over Elementor and other theme visual builders */
    display: none;
    width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.ui-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.ui-datepicker-prev,
.ui-datepicker-next {
    cursor: pointer;
    background: #f1f5f9 !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-decoration: none !important;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.ui-datepicker-next {
    order: 3;
}

.ui-datepicker-prev {
    order: 1;
}

.ui-datepicker-title {
    order: 2;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    gap: 4px;
}

.ui-datepicker-title select {
    padding: 2px !important;
    font-size: 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    background: #fff !important;
}

.ui-datepicker-calendar {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 5px;
}

.ui-datepicker-calendar th {
    font-size: 11px !important;
    color: #64748b !important;
    padding: 6px 0 !important;
    text-align: center !important;
    font-weight: 600 !important;
}

.ui-datepicker-calendar td {
    padding: 3px 2px !important;
    text-align: center !important;
}

.ui-datepicker-calendar td a {
    display: block !important;
    padding: 6px 0 !important;
    color: #334155 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    transition: all 0.1s ease;
}

.ui-datepicker-calendar td a:hover {
    background: #6366f1 !important;
    color: #ffffff !important;
}

.ui-datepicker-calendar .ui-state-active {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    font-weight: 600;
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
    display: inline-block !important;
}

/* =========================================================================
   4. VISUAL SKINS CSS VARIABLES CONFIGURATION (LIGHT & DARK - SAAS STYLE)
   ========================================================================= */
.whitetip-frontend-form-container.whitetip-theme-modern-light {
    --whitetip-primary: #6366f1;
    --whitetip-primary-hover: #4f46e5;
    --whitetip-bg: #ffffff;
    --whitetip-text-main: #0f172a;
    --whitetip-text-muted: #64748b;
    --whitetip-border: #e2e8f0;
    --whitetip-border-focus: #cbd5e1;
    --whitetip-bg-input: #f8fafc;
    --whitetip-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --whitetip-radius: 8px;
}

.whitetip-frontend-form-container.whitetip-theme-modern-dark {
    --whitetip-primary: #38bdf8;
    --whitetip-primary-hover: #0ea5e9;
    --whitetip-bg: #0f172a;
    --whitetip-text-main: #f8fafc;
    --whitetip-border: #334155;
    --whitetip-border-focus: #475569;
    --whitetip-bg-input: #1e293b;
    --whitetip-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --whitetip-radius: 8px;
}

/* =========================================================================
   5. CORE ENGINE - UNIFIED STRUCTURAL ENGINE MECHANICS (LIGHT & DARK)
   ========================================================================= */
.whitetip-frontend-form-container {
    background: var(--whitetip-bg) !important;
    padding: 30px !important;
    border-radius: var(--whitetip-radius) !important;
    border: 1px solid var(--whitetip-border) !important;
    box-shadow: var(--whitetip-shadow) !important;
    margin: 25px 0 !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: var(--whitetip-text-main) !important;
    line-height: 1.5 !important;
    transition: background 0.3s ease, border 0.3s ease !important;
}

.whitetip-frontend-form-container *,
.whitetip-frontend-form-container *::before,
.whitetip-frontend-form-container *::after {
    box-sizing: border-box !important;
}

.whitetip-frontend-form-container .whitetip-form-group label {
    display: block !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #23789d !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.whitetip-frontend-form-container input[type="text"],
.whitetip-frontend-form-container input[type="email"],
.whitetip-frontend-form-container input[type="tel"],
.whitetip-frontend-form-container input[type="number"],
.whitetip-frontend-form-container input[type="url"],
.whitetip-frontend-form-container textarea,
.whitetip-frontend-form-container select {
    margin: 0 0 10px 0;
    width: 100% !important;
    height: 42px !important;
    padding: 10px 14px !important;
    background-color: var(--whitetip-bg-input) !important;
    border: 1px solid var(--whitetip-border) !important;
    border-radius: var(--whitetip-radius) !important;
    color: var(--whitetip-text-main) !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-shadow: none !important;
    transition: all 0.2s ease-in-out !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    min-width: 0 !important;
    /* Triggers fluid layout grid compressibility elements */
}

.whitetip-frontend-form-container textarea {
    height: auto !important;
    min-height: 110px !important;
    resize: vertical !important;
}

.whitetip-frontend-form-container input:focus,
.whitetip-frontend-form-container textarea:focus,
.whitetip-frontend-form-container select:focus {
    border-color: var(--whitetip-primary) !important;
    background-color: var(--whitetip-bg) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

.whitetip-frontend-form-container ::placeholder {
    color: var(--whitetip-text-muted) !important;
    opacity: 0.6 !important;
}

/* Custom Checkbox and Radio interface rules */
.whitetip-frontend-form-container input[type="checkbox"],
.whitetip-frontend-form-container input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border: 1px solid var(--whitetip-border) !important;
    border-radius: 4px !important;
    background: var(--whitetip-bg-input) !important;
    cursor: pointer !important;
    display: inline-grid !important;
    place-content: center !important;
    margin: 0 !important;
    outline: none !important;
    transition: all 0.15s ease !important;
}

.whitetip-frontend-form-container input[type="radio"] {
    border-radius: 50% !important;
}

.whitetip-frontend-form-container input[type="checkbox"]:checked,
.whitetip-frontend-form-container input[type="radio"]:checked {
    background: var(--whitetip-primary) !important;
    border-color: var(--whitetip-primary) !important;
}

.whitetip-frontend-form-container input[type="checkbox"]:checked::before {
    content: "" !important;
    width: 8px !important;
    height: 4px !important;
    border-left: 2px solid #ffffff !important;
    border-bottom: 2px solid #ffffff !important;
    transform: rotate(-45deg) translate(1px, -1px) !important;
}

/* Submission action triggers styling handles */
.whitetip-frontend-form-container .whitetip-submit-button {
    width: auto !important;
    min-width: 140px !important;
    height: 44px !important;
    background: var(--whitetip-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--whitetip-radius) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.whitetip-frontend-form-container .whitetip-submit-button:hover {
    background: var(--whitetip-primary-hover) !important;
    transform: translateY(-1px) !important;
}

.whitetip-frontend-form-container .whitetip-submit-button:active {
    transform: translateY(0px) !important;
}

/* Theme-specific button coloring optimizations for Modern Dark template */
.whitetip-frontend-form-container.whitetip-theme-modern-dark .whitetip-submit-button {
    color: #0f172a !important;
    /* Dark fallback text matching modern neon styling selectors */
}

/* =========================================================================
   VERTICAL MIDDLE ALIGNMENT FOR RADIO & CHECKBOX OPTIONS
   ========================================================================= */
.whitetip-frontend-form-container .whitetip-form-group label:has(input[type="checkbox"]),
.whitetip-frontend-form-container .whitetip-form-group label:has(input[type="radio"]) {
    display: inline-flex !important;
    align-items: center !important;
    margin-bottom: 0 !important;
    line-height: 1 !important;
}

.whitetip-frontend-form-container input[type="checkbox"],
.whitetip-frontend-form-container input[type="radio"] {
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}