/* ======================================================
   CF7 CUSTOM STYLES — PC Web Chile Servicios
   ====================================================== */

/* --- Eliminar <br> que CF7 agrega automáticamente --- */
.wpcf7 .pcwc-cf7-wrapper br {
    display: none;
}

/* --- Wrapper general --- */
.pcwc-cf7-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Filas 2 columnas --- */
.pcwc-cf7-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .pcwc-cf7-row {
        grid-template-columns: 1fr;
    }
}

/* --- Columna full width --- */
.pcwc-cf7-col--full {
    grid-column: 1 / -1;
}

/* --- Columna: flex para apilar label + input --- */
.pcwc-cf7-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* --- Label (span) --- */
.pcwc-cf7-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #A1A1AA;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pcwc-cf7-required {
    color: #3B82F6;
    margin-left: 2px;
}

.pcwc-cf7-optional {
    color: #52525B;
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

/* --- El wpcf7-form-control-wrap ocupa todo el ancho --- */
.pcwc-cf7-col .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* --- Inputs, Selects, Textareas --- */
.pcwc-cf7-wrapper .wpcf7-form-control,
.pcwc-cf7-wrapper input[type="text"],
.pcwc-cf7-wrapper input[type="email"],
.pcwc-cf7-wrapper input[type="tel"],
.pcwc-cf7-wrapper select,
.pcwc-cf7-wrapper textarea {
    width: 100%;
    background: #27272A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 13px 16px;
    color: #F4F4F5;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.92rem;
    line-height: 1.5;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.pcwc-cf7-wrapper input::placeholder,
.pcwc-cf7-wrapper textarea::placeholder {
    color: #52525B;
}

.pcwc-cf7-wrapper input[type="text"]:focus,
.pcwc-cf7-wrapper input[type="email"]:focus,
.pcwc-cf7-wrapper input[type="tel"]:focus,
.pcwc-cf7-wrapper select:focus,
.pcwc-cf7-wrapper textarea:focus {
    border-color: rgba(59, 130, 246, 0.5);
    background: #2C2C30;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

/* --- Select: flecha personalizada --- */
.pcwc-cf7-wrapper select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%233B82F6' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 42px;
    cursor: pointer;
    color: #F4F4F5;
}

.pcwc-cf7-wrapper select option {
    background: #18181B;
    color: #F4F4F5;
}

/* --- Textarea --- */
.pcwc-cf7-wrapper textarea {
    resize: vertical;
    min-height: 110px;
}

/* --- Botón de envío --- */
.pcwc-cf7-submit {
    margin-top: 8px;
}

.pcwc-cf7-wrapper input[type="submit"],
.pcwc-cf7-wrapper .wpcf7-submit {
    width: 100%;
    background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 15px 32px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.35);
}

.pcwc-cf7-wrapper input[type="submit"]:hover,
.pcwc-cf7-wrapper .wpcf7-submit:hover {
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(30, 64, 175, 0.5);
}

.pcwc-cf7-wrapper input[type="submit"]:active {
    transform: translateY(0);
}

/* --- Ocultar spinner por defecto --- */
.pcwc-cf7-wrapper .wpcf7-spinner {
    display: none;
}

/* --- Validación: campo inválido --- */
.pcwc-cf7-wrapper .wpcf7-not-valid-tip {
    display: block;
    font-size: 0.78rem;
    color: #F87171;
    margin-top: 5px;
    font-weight: 500;
}

.pcwc-cf7-wrapper input.wpcf7-not-valid,
.pcwc-cf7-wrapper select.wpcf7-not-valid,
.pcwc-cf7-wrapper textarea.wpcf7-not-valid {
    border-color: rgba(248, 113, 113, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}

/* --- Respuesta del servidor — animación de entrada --- */
@keyframes pcwcFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Base del mensaje de respuesta --- */
.pcwc-cf7-wrapper .wpcf7-response-output {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.6;
    border: 1px solid transparent;
    animation: pcwcFadeSlideIn 0.35s ease forwards;
    position: relative;
    overflow: hidden;
}

/* Línea lateral decorativa */
.pcwc-cf7-wrapper .wpcf7-response-output::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

/* Ícono al inicio (via ::after en un wrapper) */
.pcwc-cf7-wrapper .wpcf7-response-output::after {
    content: attr(data-icon);
    font-size: 1.2rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

/* --- ÉXITO --- */
.pcwc-cf7-wrapper .wpcf7-mail-sent-ok {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: #86EFAC;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.1), inset 0 0 40px rgba(34, 197, 94, 0.03);
}

.pcwc-cf7-wrapper .wpcf7-mail-sent-ok::before {
    background: linear-gradient(to bottom, #22c55e, #16a34a);
}

.pcwc-cf7-wrapper .wpcf7-mail-sent-ok::after {
    content: '✓';
    color: #22c55e;
    font-weight: 900;
    font-size: 1.1rem;
    width: 26px;
    height: 26px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- ERROR DE ENVÍO --- */
.pcwc-cf7-wrapper .wpcf7-mail-sent-ng,
.pcwc-cf7-wrapper .wpcf7-aborted {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.25);
    color: #FCA5A5;
    box-shadow: 0 4px 20px rgba(248, 113, 113, 0.1), inset 0 0 40px rgba(248, 113, 113, 0.03);
}

.pcwc-cf7-wrapper .wpcf7-mail-sent-ng::before,
.pcwc-cf7-wrapper .wpcf7-aborted::before {
    background: linear-gradient(to bottom, #ef4444, #dc2626);
}

.pcwc-cf7-wrapper .wpcf7-mail-sent-ng::after,
.pcwc-cf7-wrapper .wpcf7-aborted::after {
    content: '✕';
    color: #ef4444;
    font-weight: 900;
    font-size: 0.85rem;
    width: 26px;
    height: 26px;
    background: rgba(248, 113, 113, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- ERRORES DE VALIDACIÓN (campos en rojo) --- */
.pcwc-cf7-wrapper .wpcf7-validation-errors {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.25);
    color: #FDE68A;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.08), inset 0 0 40px rgba(251, 191, 36, 0.03);
}

.pcwc-cf7-wrapper .wpcf7-validation-errors::before {
    background: linear-gradient(to bottom, #f59e0b, #d97706);
}

.pcwc-cf7-wrapper .wpcf7-validation-errors::after {
    content: '!';
    color: #f59e0b;
    font-weight: 900;
    font-size: 1rem;
    width: 26px;
    height: 26px;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- SPAM BLOQUEADO --- */
.pcwc-cf7-wrapper .wpcf7-spam-blocked {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.25);
    color: #FCA5A5;
}

.pcwc-cf7-wrapper .wpcf7-spam-blocked::before {
    background: linear-gradient(to bottom, #ef4444, #dc2626);
}

.pcwc-cf7-wrapper .wpcf7-spam-blocked::after {
    content: '🛡';
    font-size: 1rem;
    width: 26px;
    height: 26px;
    background: rgba(248, 113, 113, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Tip de campo inválido --- */
.pcwc-cf7-wrapper .wpcf7-not-valid-tip {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #F87171;
    margin-top: 5px;
    font-weight: 500;
}

.pcwc-cf7-wrapper .wpcf7-not-valid-tip::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: rgba(248, 113, 113, 0.2);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 900;
    color: #F87171;
    flex-shrink: 0;
}

.pcwc-cf7-wrapper input.wpcf7-not-valid,
.pcwc-cf7-wrapper select.wpcf7-not-valid,
.pcwc-cf7-wrapper textarea.wpcf7-not-valid {
    border-color: rgba(248, 113, 113, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12) !important;
}