/* ═══════════════════════════════════════════════════════════════
   Blue Ark Contact Analytics — Forms Frontend CSS
   Versión: 1.0.10
   ═══════════════════════════════════════════════════════════════ */

/* ─── Contenedor del formulario ──────────────────────────────── */
.bas-form-wrap {
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

/* ─── Fila flex que contiene los campos ──────────────────────── */
/*
   Los .bas-field-group viven DIRECTAMENTE dentro del form.
   El form tiene display:flex + flex-wrap:wrap para que los campos
   con 50% queden uno al lado del otro y los de 100% ocupen fila completa.
*/
.bas-contact-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;          /* solo gap horizontal; el vertical lo maneja margin-bottom */
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* ─── Grupo de campo individual ──────────────────────────────── */
.bas-field-group {
    box-sizing: border-box;
    margin-bottom: 16px;
    min-width: 0;         /* evita desbordamiento en flex */
}
.bas-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}
.bas-required {
    color: #dc3545;
    margin-left: 2px;
}

/* ─── Proporciones ───────────────────────────────────────────── */
.bas-w-100 { width: 100%; }
.bas-w-75  { width: calc(75% - 4px);     min-width: 0; overflow: hidden; }
.bas-w-50  { width: calc(50% - 8px);     min-width: 0; overflow: hidden; }
.bas-w-33  { width: calc(33.333% - 11px);min-width: 0; overflow: hidden; }
.bas-w-25  { width: calc(25% - 12px);    min-width: 0; overflow: hidden; }

/* Los campos hidden (UTM, referrer, honeypot) no ocupan espacio */
.bas-hp-field,
input[type="hidden"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ─── Campos de entrada ──────────────────────────────────────── */
.bas-field {
    width: 100%;
    min-width: 0;         /* crítico para flex: evita que el input expanda el contenedor */
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bas-field:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.12);
}
.bas-field::placeholder {
    color: #aaa;
}
textarea.bas-field {
    resize: vertical;
    min-height: 100px;
}
select.bas-field {
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ─── Radio y Checkbox ───────────────────────────────────────── */
.bas-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bas-radio-group label,
.bas-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    font-size: 14px;
}
.bas-radio-group input[type="radio"],
.bas-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ─── Botón de envío ─────────────────────────────────────────── */
.bas-submit-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 4px;
    width: auto;
}
.bas-submit-btn:hover,
.bas-submit-btn:focus    { background: #0073aa; color: #fff; outline: none; box-shadow: none; text-decoration: none; }
.bas-submit-btn:active   { background: #0073aa; }
.bas-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

/* El botón y los mensajes siempre ocupan 100% de la fila */
.bas-form-messages,
.bas-submit-btn-wrap {
    width: 100%;
}

/* ─── Mensajes de estado ─────────────────────────────────────── */
.bas-form-messages {
    margin: 12px 0;
    font-size: 14px;
    box-sizing: border-box;
}
.bas-form-messages.success {
    background: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}
.bas-form-messages.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
}

/* ─── Error de validación ────────────────────────────────────── */
.bas-field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}
.bas-field-error.visible { display: block; }
.bas-field.has-error     { border-color: #dc3545; }

/* ─── Responsive: móvil todo al 100% ────────────────────────── */
@media screen and (max-width: 600px) {
    .bas-w-25,
    .bas-w-33,
    .bas-w-50,
    .bas-w-75 {
        width: 100%;
    }
    /* Evitar zoom en iOS */
    .bas-field,
    .bas-submit-btn {
        font-size: 16px;
    }
}

/* ─── Política de privacidad ─────────────────────────────────── */
.bas-privacy-group {
    margin-top: 4px;
}
.bas-privacy-label {
    align-items: flex-start !important;
    gap: 10px !important;
    cursor: pointer;
    font-weight: normal !important;
    font-size: 13px !important;
    color: #555;
    line-height: 1.5;
}
.bas-privacy-checkbox {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #0073aa;
}
.bas-privacy-text a {
    color: #0073aa;
    text-decoration: underline;
}
.bas-privacy-text a:hover {
    color: #005a87;
}

/* ─── Spinner de envío ───────────────────────────────────────── */
.bas-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bas-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 2px;
}
@keyframes bas-spin {
    to { transform: rotate(360deg); }
}
