/* Ventanita para enviar sugerencias */

/* Fondo de la ventana */
.sg-fondo {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(18, 43, 29, .55);
    backdrop-filter: blur(3px);
    animation: sg-fade .18s ease-out;
}

/* Ocultar la ventana */
.sg-fondo[hidden] {
    display: none;
}

/* Ajuste del modelo de caja */
.sg-fondo * {
    box-sizing: border-box;
}

/* Ventana principal */
.sg-ventana {
    width: min(520px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--fc-crema, #fdfdfb);
    color: var(--fc-texto, #1f2a22);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(18, 41, 28, .35);
    font-family: 'DM Sans', system-ui, sans-serif;
    animation: sg-subir .22s ease-out;
}

/* Encabezado */
.sg-cab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--color-oscuro, #122b1d);
    color: #fff;
}

/* Imagen del encabezado */
.sg-cab img {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 50%;
    background: var(--fc-claro, #9dc983);
    flex-shrink: 0;
}

/* Título del encabezado */
.sg-cab h2 {
    flex: 1;
    margin: 0;
    font: 700 1.1rem 'Fraunces', Georgia, serif;
}

/* Botón para cerrar */
.sg-cerrar {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

/* Efecto al pasar el cursor */
.sg-cerrar:hover {
    background: rgba(255, 255, 255, .25);
}

/* Cuerpo del formulario */
.sg-cuerpo {
    padding: 20px 22px 22px;
}

/* Texto introductorio */
.sg-intro {
    margin: 0 0 16px;
    font-size: .92rem;
    line-height: 1.5;
    color: #3d5446;
}

/* Etiquetas de los campos */
.sg-cuerpo label {
    display: block;
    margin: 0 0 5px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--fc-verde, #2f6b3f);
}

/* Texto secundario de las etiquetas */
.sg-cuerpo label small {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #6b7a70;
}

/* Campos del formulario */
.sg-cuerpo textarea,
.sg-cuerpo input,
.sg-cuerpo select {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 14px;
    border: 1.5px solid #d4dfca;
    border-radius: 14px;
    background: #fff;
    font: inherit;
    color: inherit;
    outline: none;
}

/* Área de texto */
.sg-cuerpo textarea {
    min-height: 110px;
    resize: vertical;
    margin-bottom: 4px;
}

/* Efecto al seleccionar un campo */
.sg-cuerpo textarea:focus,
.sg-cuerpo input:focus,
.sg-cuerpo select:focus {
    border-color: var(--fc-verde, #2f6b3f);
    box-shadow: 0 0 0 3px rgba(47, 107, 63, .15);
}

/* Contador de caracteres */
.sg-contador {
    margin-bottom: 14px;
    text-align: right;
    font-size: .75rem;
    color: #6b7a70;
}

/* Distribución de dos campos */
.sg-dos {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 12px;
}

/* Campo oculto antispam */
.sg-trampa {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
}

/* Mensaje de error */
.sg-error {
    min-height: 1.2em;
    margin: 0 0 8px;
    font-size: .88rem;
    color: #b3372f;
}

/* Contenedor de botones */
.sg-botones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Estilos generales de los botones */
.sg-env,
.sg-sec {
    padding: 11px 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}

/* Botón para enviar */
.sg-env {
    background: var(--color-oscuro, #122b1d);
    color: #fff;
}

/* Efecto del botón enviar */
.sg-env:hover {
    background: var(--fc-verde, #2f6b3f);
}

/* Botón enviar deshabilitado */
.sg-env:disabled {
    opacity: .6;
    cursor: wait;
}

/* Botón secundario */
.sg-sec {
    background: var(--fc-suave, #e8f0ea);
    color: var(--color-oscuro, #122b1d);
    border: 1.5px solid #d4dfca;
}

/* Efecto del botón secundario */
.sg-sec:hover {
    background: #dbe8dc;
}

/* Pantalla de agradecimiento */
.sg-gracias {
    text-align: center;
    padding: 34px 22px 30px;
}

/* Título de agradecimiento */
.sg-gracias h3 {
    margin: 12px 0 6px;
    font: 700 1.3rem 'Fraunces', Georgia, serif;
    color: var(--color-oscuro, #122b1d);
}

/* Texto de agradecimiento */
.sg-gracias p {
    margin: 0 0 20px;
    color: #3d5446;
}

/* Icono de confirmación */
.sg-check {
    width: 62px;
    height: 62px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--fc-suave, #e8f0ea);
    color: var(--fc-verde, #2f6b3f);
    font-size: 2rem;
    line-height: 62px;
    font-weight: 700;
}

/* Accesibilidad: enfoque con teclado */
.sg-cuerpo :focus-visible,
.sg-cerrar:focus-visible {
    outline: 3px solid rgba(47, 107, 63, .35);
    outline-offset: 2px;
}


/* Botón de acción dentro del chat */

/* Contenedor del botón */
.fc-accion-fila {
    align-self: flex-start;
    margin-left: 60px;
}

/* Botón de acción */
.fc-accion {
    padding: 9px 16px;
    border: 1.5px solid var(--fc-verde, #2f6b3f);
    border-radius: 999px;
    background: #fff;
    color: var(--color-oscuro, #122b1d);
    font: inherit;
    font-size: .9rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}

/* Efecto al pasar el cursor */
.fc-accion:hover {
    background: var(--fc-verde, #2f6b3f);
    color: #fff;
}


/* Animaciones */

/* Aparición del fondo */
@keyframes sg-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Entrada de la ventana */
@keyframes sg-subir {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}


/* Accesibilidad: reducir animaciones */
@media (prefers-reduced-motion: reduce) {
    .sg-fondo,
    .sg-ventana {
        animation: none;
    }
}


/* Adaptación para móviles */
@media (max-width: 480px) {
    .sg-dos {
        grid-template-columns: 1fr;
    }

    .sg-botones {
        flex-direction: column-reverse;
    }

    .sg-env,
    .sg-sec {
        width: 100%;
    }
}