/*
 * ═══════════════════════════════════════════════════════════════════
 * CUBIERTAS DAVID - ESTILOS DEL FORMULARIO DE CONTACTO
 * Estilos para el widget de formulario del sidebar
 * ═══════════════════════════════════════════════════════════════════
 */

/* ─── Widget completo del formulario en sidebar ─── */
.contact-form-widget {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(27, 75, 138, 0.15);
    overflow: hidden;
    border: 2px solid rgba(27, 75, 138, 0.1);
}

/* ─── Cabecera del formulario ─── */
.form-header {
    background: linear-gradient(135deg, #1B4B8A 0%, #133870 100%);
    color: #fff;
    padding: 1.5rem;
    text-align: center;
}

.form-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.form-header p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* ─── Formulario ─── */
.contact-form {
    padding: 1.5rem;
}

/* ─── Grupos de campos ─── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 0.375rem;
    font-family: 'Montserrat', sans-serif;
}

/* Texto "(Opcional)" junto al label */
.optional {
    font-weight: 400;
    color: #999;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* ─── Campos del formulario ─── */
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid #dde3ed;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #2c2c2c;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: #1B4B8A;
    box-shadow: 0 0 0 3px rgba(27, 75, 138, 0.12);
}

.form-control.valid {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-control.error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

/* Select */
select.form-control {
    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='%23666' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

/* Input file */
.form-control-file {
    width: 100%;
    padding: 0.5rem;
    border: 2px dashed #dde3ed;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
    background-color: #f5f7fa;
}

.form-control-file:hover {
    border-color: #1B4B8A;
    background-color: #eef3fb;
}

/* Texto de ayuda bajo el campo */
.form-help {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.375rem;
    line-height: 1.4;
}

/* ─── Checkbox de privacidad ─── */
.form-checkbox {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #1B4B8A;
    cursor: pointer;
}

.checkbox-label a {
    color: #1B4B8A;
    text-decoration: underline;
}

/* ─── Mensajes de error de campo ─── */
.field-error {
    font-size: 0.75rem;
    color: #c0392b;
    margin-top: 0.25rem;
    display: block;
}

/* ─── Contador de caracteres ─── */
.char-counter {
    display: block;
    font-size: 0.72rem;
    margin-top: 0.25rem;
    color: #999;
}

/* ─── Botón de envío ─── */
.contact-form .btn-primary {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.btn-text,
.btn-loading {
    display: inline;
}

/* ─── Mensaje de estado (éxito / error) ─── */
.form-message {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ─── Footer del formulario (métodos de contacto alternativos) ─── */
.form-footer {
    background-color: #f5f7fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dde3ed;
    text-align: center;
}

.form-footer-text {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.75rem;
}

.contact-methods {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contact-method:first-child {
    background-color: #1B4B8A;
    color: #fff;
}

.contact-method:last-child {
    background-color: #25d366;
    color: #fff;
}

.contact-method:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.contact-method .icon {
    font-size: 1rem;
}

.contact-method .text {
    font-size: 0.8rem;
}

/* ─── Responsive: formulario en columna completa (móvil) ─── */
@media (max-width: 768px) {
    .contact-form-widget {
        border-radius: 12px;
    }

    .form-header {
        padding: 1.25rem;
    }

    .contact-form {
        padding: 1.25rem;
    }
}
