/* ══════════════════════════════════════════════════════
   WC Cotizaciones v1.1 – cotizacion.css
   ══════════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────────── */
.wcc-form-wrapper {
    max-width: 680px;
    margin: 0 auto;
    font-family: inherit;
}

/* ── Grid de campos ─────────────────────────────────── */
.wcc-form-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wcc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wcc-field--full {
    grid-column: 1 / -1;
}

/* ── Labels ─────────────────────────────────────────── */
.wcc-field label {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.wcc-req {
    color: #e53935;
}

.wcc-label-hint {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
}

/* ── Inputs y textarea ───────────────────────────────── */
.wcc-field input[type="text"],
.wcc-field input[type="email"],
.wcc-field input[type="tel"],
.wcc-field input[type="number"],
.wcc-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.wcc-field input:focus,
.wcc-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wcc-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* ── Campo RUT ───────────────────────────────────────── */
#wcc_rut {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    letter-spacing: 0.04em;
}

/* Feedback debajo del RUT */
.wcc-field-feedback {
    font-size: 13px;
    font-weight: 500;
    min-height: 18px;
    display: block;
}

.wcc-feedback--ok {
    color: #16a34a;
}

.wcc-feedback--error {
    color: #dc2626;
}

/* ── Error de validación ─────────────────────────────── */
.wcc-input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* ── Select2 ─────────────────────────────────────────── */
.wcc-field .select2-container {
    width: 100% !important;
}

.wcc-field .select2-container--default .select2-selection--multiple {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    min-height: 42px;
}

.wcc-field .select2-container--default.select2-container--focus
    .select2-selection--multiple {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.wcc-field .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice {
    background-color: #2563eb;
    border: none;
    color: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 13px;
}

.wcc-field .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice__remove {
    color: rgba(255,255,255,0.8);
    margin-right: 5px;
}

/* ── CAPTCHA propio ──────────────────────────────────── */
.wcc-captcha-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wcc-captcha-img-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#wcc_captcha_img {
    display: block;
    width: 200px;
    height: 60px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f5f7fa;
    /* Prevenir que el usuario pueda arrastrar/guardar la imagen */
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.wcc-captcha-refresh {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.wcc-captcha-refresh:hover {
    color: #2563eb;
    border-color: #2563eb;
    transform: rotate(20deg);
}

.wcc-captcha-input {
    width: 110px !important;
    text-align: center;
    font-size: 18px !important;
    font-weight: 600 !important;
    flex-shrink: 0;
}

/* Ocultar flechas del input number en CAPTCHA */
.wcc-captcha-input::-webkit-outer-spin-button,
.wcc-captcha-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcc-captcha-input[type=number] {
    -moz-appearance: textfield;
}

/* ── Hints ───────────────────────────────────────────── */
.wcc-field-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 0;
}

/* ── Botón enviar ────────────────────────────────────── */
.wcc-btn-enviar {
    display: inline-block;
    padding: 12px 28px;
    background: #e53935;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}

.wcc-btn-enviar:hover:not(:disabled) {
    background: #c62828;
}

.wcc-btn-enviar:active:not(:disabled) {
    transform: scale(0.98);
}

.wcc-btn-enviar:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Mensajes de respuesta ───────────────────────────── */
.wcc-mensaje {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.wcc-mensaje--exito {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}

.wcc-mensaje--error {
    background: #fef2f2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

/* ── Privacidad ──────────────────────────────────────── */
.wcc-privacidad p {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.5;
}

.wcc-privacidad a {
    color: #2563eb;
    text-decoration: underline;
}

/* ── Responsivo ──────────────────────────────────────── */
@media (max-width: 600px) {
    .wcc-form-fields {
        grid-template-columns: 1fr;
    }

    .wcc-captcha-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .wcc-btn-enviar {
        width: 100%;
        text-align: center;
    }
}
