/* Callback Modal Styles */

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

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

/* Modal Container */
.cb-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    background: var(--white);
    z-index: 10001;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.cb-modal.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Close Button */
.cb-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    line-height: 1;
    z-index: 2;
}

.cb-close:hover {
    color: var(--black);
}

/* Inner Content */
.cb-inner {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Header */
.cb-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.cb-logo {
    height: 40px;
    width: auto;
}

/* Content */
.cb-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cb-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--black);
    margin: 0;
    line-height: 1.3;
}

.cb-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

/* Form Fields */
.cb-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cb-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    transition: border-color 0.2s;
}

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

.cb-field-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}

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

.cb-field input,
.cb-field select {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-dark);
    font-family: var(--font-primary);
}

.cb-field input::placeholder {
    color: var(--text-muted);
}

.cb-field 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;
}

/* Buttons */
.cb-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;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: var(--font-primary);
}

.cb-btn svg {
    width: 20px;
    height: 20px;
}

.cb-btn-primary {
    background: #dc2626;
    color: white;
}

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

/* Privacy Notice */
.cb-privacy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    justify-content: center;
}

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

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

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

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

    .cb-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

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

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

/* Contact Form 7 Integration */
.cb-cf7-form .wpcf7-form-control-wrap {
    margin-bottom: 0.75rem;
}

.cb-cf7-form .wpcf7-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    background: var(--white);
    transition: border-color 0.2s;
}

.cb-cf7-form .wpcf7-form-control:focus {
    border-color: var(--green-primary);
    outline: none;
}

.cb-cf7-form .wpcf7-form-control[type="text"],
.cb-cf7-form .wpcf7-form-control[type="tel"] {
    appearance: none;
}

.cb-cf7-form .wpcf7-form-control[type="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 1rem center;
    padding-right: 2.5rem;
}

.cb-cf7-form .wpcf7-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-primary);
    margin-top: 0.5rem;
}

.cb-cf7-form .wpcf7-submit:hover {
    background: #b91c1c;
}

.cb-cf7-form .wpcf7-submit:disabled {
    background: #999;
    cursor: not-allowed;
}

/* WhatsApp Button */
.cb-btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-primary);
    margin-top: 0.75rem;
}

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

.cb-btn-whatsapp svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cb-cf7-form .wpcf7-form-control-wrap .wpcf7-not-valid-tip {
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.25rem;
    display: block;
}

.cb-cf7-form .wpcf7-response-output {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.cb-cf7-form .wpcf7-response-output.wpcf7-mail-sent-ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.cb-cf7-form .wpcf7-form-control-wrap.wpcf7-validation-failed {
    border-color: #dc2626;
}

.cb-cf7-form .wpcf7-form-control-wrap.wpcf7-validation-failed .wpcf7-form-control {
    border-color: #dc2626;
}

/* Success Message */
.cb-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    margin-top: 1rem;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cb-success.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.cb-success svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
    color: #16a34a;
}

.cb-success h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

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

/* Custom CF7 response — matches existing wpcf7-mail-sent-ok but visible inside modal */
.cb-cf7-form .wpcf7-response-output.cb-custom-response {
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Error Message */
.cb-error {
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}
