/* ==========================================================================
   Callback Modal Styles — modeled after hovet.in callback design
   ========================================================================== */

/* --- Overlay ----------------------------------------------------------- */

.kilv-cb-overlay {
    position: fixed;
    inset: 0;
    background: rgba( 0, 0, 0, 0.5 );
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.kilv-cb-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- Modal Container --------------------------------------------------- */

.kilv-cb-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate( -50%, -50% ) scale( 0.95 );
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    background: #fff;
    z-index: 9999;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
    overflow-y: auto;
    overscroll-behavior: contain;
}

.kilv-cb-modal:not([hidden]) {
    opacity: 1;
    transform: translate( -50%, -50% ) scale( 1 );
    animation: kilv-cb-scale-in 0.3s cubic-bezier( 0.4, 0, 0.2, 1 ) both;
}

@keyframes kilv-cb-scale-in {
    from {
        opacity: 0;
        transform: translate( -50%, -50% ) scale( 0.95 );
    }
    to {
        opacity: 1;
        transform: translate( -50%, -50% ) scale( 1 );
    }
}

/* --- Close Button ------------------------------------------------------ */

.kilv-cb-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    line-height: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.kilv-cb-close:hover {
    background: rgba( 0, 0, 0, 0.06 );
    color: #000;
}

/* --- Inner Content ----------------------------------------------------- */

.kilv-cb-inner {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- Header ------------------------------------------------------------ */

.kilv-cb-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.kilv-cb-logo {
    height: 36px;
    width: auto;
    margin-bottom: 0.75rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.kilv-cb-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    font-family: "Poppins", sans-serif;
}

.kilv-cb-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
    font-family: "Inter", sans-serif;
}

/* --- Form Fields (inline icon layout) ----------------------------------- */

.kilv-cb-field-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid #eaeaea;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}

.kilv-cb-field-wrap:last-child {
    margin-bottom: 0;
}

.kilv-cb-field-wrap:focus-within {
    border-color: var(--green-primary);
}

.kilv-cb-field-icon {
    flex-shrink: 0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kilv-cb-field-icon svg {
    width: 20px;
    height: 20px;
}

.kilv-cb-field-wrap input,
.kilv-cb-field-wrap select {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: #333;
    font-family: "Inter", sans-serif;
    min-width: 0;
    padding: 0;
}

.kilv-cb-field-wrap input[type="text"],
.kilv-cb-field-wrap input[type="tel"] {
    box-sizing: border-box;
    width: 100%;
}

.kilv-cb-field-wrap input::placeholder {
    color: #999;
}

.kilv-cb-field-wrap select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* --- Submit Button ----------------------------------------------------- */

.kilv-cb-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: "Inter", sans-serif;
    background: #dc2626;
    color: #fff;
    width: 100%;
    margin-top: 0.75rem;
}

.kilv-cb-submit-btn:hover {
    background: #b91c1c;
}

.kilv-cb-submit-btn:active {
    background: #991b1b;
}

.kilv-cb-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* --- WhatsApp Alternative Button --------------------------------------- */

.kilv-cb-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    font-family: "Inter", sans-serif;
    margin-top: 0.75rem;
}

.kilv-cb-whatsapp-btn:hover {
    background: #128C7E;
    color: #fff;
}

/* --- Privacy Notice ---------------------------------------------------- */

.kilv-cb-privacy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    justify-content: center;
}

.kilv-cb-privacy svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #999;
}

/* --- Response Messages ------------------------------------------------- */

.kilv-cb-response {
    margin-top: 1rem;
    min-height: 0;
    transition: min-height 0.3s ease;
}

.kilv-cb-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: kilv-cb-fade-in 0.3s cubic-bezier( 0.4, 0, 0.2, 1 ) both;
}

.kilv-cb-success h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: "Poppins", sans-serif;
}

.kilv-cb-success p {
    margin: 0;
    color: #15803d;
    font-size: 0.9rem;
}

.kilv-cb-success svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
    color: #16a34a;
    flex-shrink: 0;
}

.kilv-cb-error {
    padding: 1rem 1.25rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    animation: kilv-cb-fade-in 0.3s cubic-bezier( 0.4, 0, 0.2, 1 ) both;
}

.kilv-cb-error strong {
    font-weight: 600;
}

@keyframes kilv-cb-fade-in {
    from {
        opacity: 0;
        transform: scale( 0.95 );
    }
    to {
        opacity: 1;
        transform: scale( 1 );
    }
}

/* --- Contact Form 7 Integration ---------------------------------------- */

/* Hide CF7's auto-generated submit button — we use our own custom one */
.kilv-cb-cf7 .wpcf7-submit {
    display: none !important;
}

/* Hide CF7 validation tips — not used with our native HTML5 validation */
.kilv-cb-cf7 .wpcf7-not-valid-tip {
    display: none !important;
}

/* --- Responsive -------------------------------------------------------- */

@media ( max-width: 480px ) {
    .kilv-cb-modal {
        width: 95%;
        max-width: none;
        border-radius: 12px;
    }

    .kilv-cb-inner {
        padding: 1.5rem 1rem;
    }

    .kilv-cb-title {
        font-size: 1.3rem;
    }

    .kilv-cb-submit-btn,
    .kilv-cb-whatsapp-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

@media ( min-width: 768px ) and ( max-width: 1024px ) {
    .kilv-cb-modal {
        width: 85%;
        max-width: 400px;
    }
}

@media ( min-width: 1024px ) {
    .kilv-cb-modal {
        width: 420px;
    }
}
